• Welcome to Dark Bit Factory & Gravity.
 

Change a 2D Sprite Colour

Started by Pot Noodle, August 06, 2013

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Pot Noodle

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.

KrazyK

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)


Challenge Trophies Won:

Pot Noodle

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

Hotshot

Quote
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  ::)

emook

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
----

R Tape loading error, 0:1