Every click an attribute change?? [SOLVED]
Hello all,
So I made a helpbutton in my app.
On click > change boolean to true
If boolean is true > spawn actor 'gametips'.
So when people click the helpbutton, an actor with gametips spawn..
However, I want it, that if you click it again, the boolean goes off to 0 again, so people can toggle the tips on and off.
How do I make this?
Best regards,
So I made a helpbutton in my app.
On click > change boolean to true
If boolean is true > spawn actor 'gametips'.
So when people click the helpbutton, an actor with gametips spawn..
However, I want it, that if you click it again, the boolean goes off to 0 again, so people can toggle the tips on and off.
How do I make this?
Best regards,
Comments
You Need to add another boolean called changingvisible or something.
Then create these rules
Rule-when.touch.is.pressed and game.changingvisible=false
Change attribute game.changingvisible to true
Nested rule
when.changing visible is true
Change.attriubute.game.tipson to True
Now to turn it off
Rule-when.touch.is.pressed and game.changingvisible is false
when attribute.game.tipson=true
Change attribute changingvisible to true
Nested rule
when attribute.game.tipson=true and game.changingvisible is true
Change attriubute game.tipson to false
Also make sure you add this rule
Rule-When.touch.is.released change attribute game.changingvisible to false
attribute:
switch (index)
rule:
on touch pressed, change attribute switch To: (switch+1)%2
the result is 1 or 0