Dark Bit Factory & Gravity

PROGRAMMING => Purebasic => Topic started by: Pot Noodle on August 06, 2013

Title: Change a 2D Sprite Colour
Post 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.
Title: Re: Change a 2D Sprite Colour
Post by: KrazyK on August 06, 2013
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)


Title: Re: Change a 2D Sprite Colour
Post by: Pot Noodle on August 06, 2013
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
Title: Re: Change a 2D Sprite Colour
Post by: Hotshot on August 07, 2013
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  ::)
Title: Re: Change a 2D Sprite Colour
Post by: emook on August 11, 2013
You need to use this before you display your sprites :

Code: [Select]
  SpriteBlendingMode(#PB_Sprite_BlendSourceAlpha, #PB_Sprite_BlendInvertSourceAlpha)
http://www.purebasic.fr/english/viewtopic.php?f=13&t=55009