Help in creating a global variable to change actor color RGB

JCFordJCFord Member Posts: 785
edited November -1 in Working with GS (Mac)
I have a large amount of different actors on my stage and I want to be able to change their individual colours on a click.

I know I could place the same 50 game.whatcolor rules onto each actor, but if I need to tweak the colour amounts I would have to go through each of the actor and make the same changes multiple times.

EG on each actor I could have:

RULE:
Actor receives event Touch is pressed

NESTED RULE:
If Attribute game.whatcolor = 1
Change attribute self.colour.red to 1
Change attribute self.colour.green to 0
Change attribute self.colour.blue to 0

NESTED RULE:
If Attribute game.whatcolor = 2
Change attribute self.colour.red to 0
Change attribute self.colour.green to 1
Change attribute self.colour.blue to 0.5

NESTED RULE:
If Attribute game.whatcolor = 3
Change attribute self.colour.red to 1
Change attribute self.colour.green to 0.25
Change attribute self.colour.blue to 0.5

etc, etc, etc

But is there a way I could have all the color variables in a SINGLE actor off screen, so if I need to make any changes I only need to do it once and then call these variables from each of the actors, I can't seem to work it out as I wouldn't be able to use the SELF attribute?

Thanks for any help or advice
JCFord

Comments

Sign In or Register to comment.