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