The game is a top down view, so I'm not sure the horizontal surface still 
applies. (Honestly not even sure how I would do this in the first place.)

The problem is, I need it to blend into the background water image. Here is 
what I am doing right now:
http://i.imgur.com/rl9FY3o.jpg

It's separated into the head and body and I get regions to separate them 
into the two sprites. I basically have to get all the sprites in the water, 
then do some operations to alter the regions and set the alpha/rgb. I did 
test with the overlay mentioned in a previous post, but I couldn't get an 
effect I was looking for. My way works, but it just seems like such a hack 
at the moment and doesn't support partial coverage yet. Maybe this is the 
proper way?

I don't really feel too comfortable with 3D OpenGL yet so I am just using 
an orthographic projection so I'm sure that limits my options unfortunately.

On Sunday, May 29, 2016 at 9:14:52 PM UTC-5, Benjamin Moran wrote:
>
> I think Greg has the right idea. If you're not keen on going 3D, then I'm 
> sure there are other ways to fake the effect in 2D. If you happened to have 
> a link to a picture showing the effect you're trying to create, it might 
> help with the suggestions. 
> -Ben
>
>
> On Monday, May 30, 2016 at 4:01:40 AM UTC+9, Charles wrote:
>>
>> I was actually planning on doing this, but the ground and water tiles are 
>> 32x32 and the player sprites are smaller so it would appear totally 
>> submerged. I am trying to create some 'fake' 2D perspective on how high the 
>> water depth looks in relation to the player. The lower half of the 
>> character may be 12 pixels and I would want that part considered 
>> 'submerged' when it is over the water tile rather than the whole player. 
>>
>> On Saturday, May 28, 2016 at 7:06:21 PM UTC-5, Elliot Hallmark wrote:
>>>
>>> I think they meant let the water have an alpha channel of like .5 or 
>>> something, and draw the character behind it.  No extra sprites/textures
>>>
>>
>> =========
>>
>> Oh I see, so a duplicate sprite overlayed that I can just manipulate the 
>> height, RGBA, blending, and can just offset it. I guess that's another way, 
>> seems similar to what I'm doing but without all the expensive cropping of 
>> textures constantly. Not sure why that never occurred to me.
>>
>> I did also want to look into modifying pixel data as well, so your 
>> example helps out quite a lot. Thanks for your input!
>>
>> On Saturday, May 28, 2016 at 6:42:40 PM UTC-5, [email protected] wrote:
>>>
>>> I believe what he's suggesting is leaving your original sprite intact, 
>>> and having a second texture with a transparent alpha channel rendered on 
>>> top to act as a water overlay rather than going through the trouble of 
>>> splitting one sprite in two all the time. Basically a form of cel animation 
>>> overlay, which could involve blending or color keying, depending.
>>>
>>> If strictly talking about modifying pixel data over specific regions, 
>> one method i've played with would be using Numpy Array operations to 
>> dynamically modify pixel data. I've attached an example script. 
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to