Dark Bit Factory & Gravity
PROGRAMMING => Purebasic => Topic started by: Pot Noodle on August 06, 2013
-
Just wondering if anyone knows how to change a sprite colour in PB
A 2D sprite that is, I guess messing with the memory in some way would service.
Any help would be great, Thanks.
-
If you're using PB5.20 then the 2D and 3D sprite commands have been bundled into one library. There is no Start3D()/Stop3D() /DisplaySprite3D commands now, so you can use:
DisplayTransparentSprite(SprintNum,x,y,Intensity,Colour)
I used this technique for the colour cycling on the BigDemo. I can't remember if you need a an 8bit colour sprite for this though off the top of my head. Give it a whirl with the new version (beta 8 at the moment)
-
I have tested this but with no luck as I only want to change one colour on the sprite :(
Sorry if I didn't mention this before.
Thanks
-
If you're using PB5.20 then the 2D and 3D sprite commands have been bundled into one library. There is no Start3D()/Stop3D() /DisplaySprite3D commands now, so you can use:
DisplayTransparentSprite(SprintNum,x,y,Intensity,Colour)
I used this technique for the colour cycling on the BigDemo. I can't remember if you need a an 8bit colour sprite for this though off the top of my head. Give it a whirl with the new version (beta 8 at the moment)
About time they have sort out that out :clap: and what about with Stupid 2D Commands like Startdrawing() and stopdrawing() as they should get rid of it becaue it can be confusing when newbie program want do simple things ::)
-
You need to use this before you display your sprites :
SpriteBlendingMode(#PB_Sprite_BlendSourceAlpha, #PB_Sprite_BlendInvertSourceAlpha)
http://www.purebasic.fr/english/viewtopic.php?f=13&t=55009