Clipping a sprite

Blitz3D Forums/Blitz3D Beginners Area/Clipping a sprite

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I found the easiest way of doing this was to scale a sprite over the top of another one. Of course this will knacker any graphics you've actually got on the sprite.

The other way is to create the sprite by copyrecting onto the texture, of course this isn't as fast as it would like to be.


Thinking about it though...

You could probably do some funky thing using 2 quads... ie |\|\| type affair (if you get what I mean)

Have a texture where the top half is the 'off' texture and the bottom half is the 'on' texture.
Now, apply the top half of the texture to the left hand quad and the bottom half of the texture to the right hand quad.
Then move the middle line (between the quads left and right) based on the health of the bar.
You will also have to do some funky stuff about realigning the UVs but that won't be hard... That might just work you know!