Change Entity Color


(blameMike) #1

Is there an easy way to just turn an entities graphic a different color? I could have sworn I saw this somewhere, but I can’t find it now. Basically, I want to make an enemy red when he gets hit, and would love to avoid making a red sprite for this. Thanks so much for any help.


(Jacob Albano) #2

myImage.color = 0xff0000;
myImage.tint = 0.5;

:smile:

Make sure your graphic is an Image (or a subclass of Image). The base Graphic class doesn’t have a color property.


(blameMike) #4

I was able to get it working by casting it. Thanks so much!