The Daily Click ::. Forums ::. Klik Coding Help ::. Local palette-swap?
 

Post Reply  Post Oekaki 
 

Posted By Message

Benny Lindberg



Registered
  08/11/2010
Points
  54
21st November, 2010 at 17:40:26 -

Hiya!
I was wondering, is it possible to do a palette-swap on only one instance of an active object? Let's say i have a value that is Shieldpoints, and whenever that value
is over 0, black is replaced by another color, and if zero or lower, it is switched back.
I got this working as it is, except when the shieldpoints of one active object goes down to 0, all active object change back to black. Any ideas on how to solve this?

 
n/a

HorrendousGames

Sourpuss

Registered
  31/10/2009
Points
  481

VIP MemberEvil klikerGame Of The Week Winner
21st November, 2010 at 17:57:16 -

I've tried to get this to work with no really decent result. I kind of wish that click products would have that tint feature that XNA does.

One option you could do is to make a copy of your sprite, and erase everything but the area you want to change the color of, then make it a solid color and semi transparent some. Then, in an always event, make the semi transparent sprite have the same x and y as the original, as well as having the same animation. Make a copy of this code, put one at the start of all your code and one at the end (that should ensure that it doesn't move). Then, use the color changer event to change the color to whatever you'd like. For a more effective color change, try changing the effected area on the original sprite to black and white. You can do that almost instantly in a program like Photoshop or GIMP.

It's not the best way, since you'll have an extra active with semi transparency, but that's the only way I can think of at the moment. Someone else might have something better.

 
/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/
That Really Hot Chick
now on the Xbox Live Marketplace!

http://marketplace.xbox.com/en-US/Product/That-Really-Hot-Chick/66acd000-77fe-1000-9115-d80258550942

http://www.create-games.com/project.asp?view=main&id=2160

Benny Lindberg



Registered
  08/11/2010
Points
  54
21st November, 2010 at 19:20:17 -

Thanks for the advice, but I was hoping for something that doesnt require a separate active object, since that'll double the amount of active objects used for enemies.

Still, thanks!

 
n/a

HorrendousGames

Sourpuss

Registered
  31/10/2009
Points
  481

VIP MemberEvil klikerGame Of The Week Winner
21st November, 2010 at 19:22:58 -

Hey no problem. That kind of stuff is fine if you aren't planning on having a ton on screen, but it sounds like you'll have quite a bit going on.

 
/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/
That Really Hot Chick
now on the Xbox Live Marketplace!

http://marketplace.xbox.com/en-US/Product/That-Really-Hot-Chick/66acd000-77fe-1000-9115-d80258550942

http://www.create-games.com/project.asp?view=main&id=2160

Benny Lindberg



Registered
  08/11/2010
Points
  54
23rd November, 2010 at 00:13:06 -

I wonder, could this be done by referring to a fixed value or a spread value? I don't have much experience using them myself and I'm not sure how they work, but perhaps someone knows a thing or two?

 
n/a
   

Post Reply



 



Advertisement

Worth A Click