Author Topic: Change a 2D Sprite Colour  (Read 1554 times)

0 Members and 1 Guest are viewing this topic.

Offline Pot Noodle

  • Sponsor
  • Amiga 1200
  • *******
  • Posts: 271
  • Karma: 15
  • Computers have lots of memory but no imagination
    • View Profile
Change a 2D Sprite Colour
« 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.

Offline KrazyK

  • Amiga 1200
  • ****
  • Posts: 278
  • Karma: 121
    • View Profile
    • KrazyK Remakes
Re: Change a 2D Sprite Colour
« Reply #1 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)


Challenge Trophies Won:

Offline Pot Noodle

  • Sponsor
  • Amiga 1200
  • *******
  • Posts: 271
  • Karma: 15
  • Computers have lots of memory but no imagination
    • View Profile
Re: Change a 2D Sprite Colour
« Reply #2 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

Offline Hotshot

  • DBF Aficionado
  • ******
  • Posts: 2114
  • Karma: 91
    • View Profile
Re: Change a 2D Sprite Colour
« Reply #3 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  ::)

Offline emook

  • C= 64
  • **
  • Posts: 88
  • Karma: 12
    • View Profile
Re: Change a 2D Sprite Colour
« Reply #4 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
----

R Tape loading error, 0:1