playMaker

Author Topic: Set color of a sprite directly (SOLVED)  (Read 3962 times)

snortch

  • Playmaker Newbie
  • *
  • Posts: 31
Set color of a sprite directly (SOLVED)
« 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
« Last Edit: July 31, 2015, 02:33:58 PM by snortch »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Set color of a sprite directly
« Reply #1 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.

snortch

  • Playmaker Newbie
  • *
  • Posts: 31
Re: Set color of a sprite directly
« Reply #2 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!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Set color of a sprite directly (SOLVED)
« Reply #3 on: July 31, 2015, 02:57:55 PM »
np, nice graphics btw :)

snortch

  • Playmaker Newbie
  • *
  • Posts: 31
Re: Set color of a sprite directly (SOLVED)
« Reply #4 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


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Set color of a sprite directly (SOLVED)
« Reply #5 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


 Bye,

 Jean