Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: snortch on July 31, 2015, 11:30:08 AM

Title: Set color of a sprite directly (SOLVED)
Post by: snortch on July 31, 2015, 11:30:08 AM
I am trying to set the color of a sprite and not having any luck. This video explains what I'm trying to accomplish:

https://goo.gl/P6Hr3r

As you can see, I am trying to use Set Material Color to change the color of my "Dragon Health" sprite. Somehow, the color is changing to black instead of the color I want it to be (red).

In reading through the forum, it looks like I might need to set the desired color value to a variable and then set the color that way?? If that's correct, how is that accomplished?

Thanks
Title: Re: Set color of a sprite directly
Post by: djaydino on July 31, 2015, 02:00:25 PM
Hi,
try dragging the sprite renderer into you state and use "set properties" then select in the property option  "color" and again "color"
then you can set your desired color.
Title: Re: Set color of a sprite directly
Post by: snortch on July 31, 2015, 02:30:55 PM
Nice! That totally worked - thank you so much. For anyone interested, here's how to drag the sprite renderer into the state and set the color property how djaydino suggested:

https://goo.gl/Jqim2J

Thanks again!
Title: Re: Set color of a sprite directly (SOLVED)
Post by: djaydino on July 31, 2015, 02:57:55 PM
np, nice graphics btw :)
Title: Re: Set color of a sprite directly (SOLVED)
Post by: snortch on July 31, 2015, 03:04:23 PM
Thanks, but I can't take credit for those. They came from "The Gamemakers Apprentice" which is a book that teaches how to use Gamemaker to make this game and a bunch of others. Quite a useful book for graphics and stuff if you're trying to learn:
http://goo.gl/ec1PK0

Title: Re: Set color of a sprite directly (SOLVED)
Post by: jeanfabre on July 31, 2015, 03:15:06 PM
Hi,

 There is an action for this in the uGui set, called uGuiGraphicSetColor.

It's available on the Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181)


 Bye,

 Jean