I am trying to create a way I can change specific colors on regions on a sprite.
Right now, my method is to take the original texture, slice it into two regions, top and bottom. Create two sprites for each, make sure they offset each other properly, then simply set the RGBA values on the sprite I want. However, this seems inefficient as now I have two sprites that must be updated constantly and makes it awkward when I want to adjust the color height. For example, if the player steps into water, the water may have varying depth. Constantly creating sprites as the level rises or lowers, pixel by pixel, would be a big performance hit I would imagine. I've thought about the image data access and setting pixels, but this would affect all of the sprites that use that image, or am I wrong? Also, my method falls short when I want to just take a section of the sprite (say like an 8x8 square in the center) and color it. Since it can't be resolved through square regions. Maybe I am complicating it too much or is there is an alternate method? -- 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.
