2D Toolkit Forum
2D Toolkit => Support => Topic started by: Jefemcownage on June 06, 2012, 05:03:11 pm
-
I'm currently tinting a sprite red as it takes more damage in a prototype i'm doing but I would like to overlay a sprite, perhaps even having a small texture that just repeats, on only the non-transparent pixels. Is this possible with 2d toolkit?
-
This isn't possible out of the box.
The most efficient way to do this is probably with a shader, but it will mean a unique draw call for the object.
-
Ok thanks any good places to start looking for a good shader?
-
You can take the Blend2TexVertexColor shader, and base yours off that. Ideally, you should modify the sprite class to output a second UV channel, so you'll be able to use this shader directly. You can do this by creating a copy of the tk2dSprite class and modifying it to do that.