How to destroy an actor when a different actor is pressed
TheTiger
Member Posts: 53
Hi everyone, I have an arrow button actor on my game screen, and I have a text actor on my game screen. Basically when i touch the arrow button actor I want the text actor to disappear, so how would I do that.
Thanks.
Comments
Make a destroy attribute named "destroyText."
Make this attribute an integer and set it to 0.
Tell the arrow that when it is pressed it should change game.destroyText to 1.
Tell the text actor that when game.destroyText = 1, destroy.
Ok thank you for that Rabid Parrot.
Make a new boolean attribute called (arrow pressed), and create an invisible texture called (invis). On the arrow actor: when pressed, change attribute (arrow pressed) to true, else: change attribute (arrow pressed) to false.
Then go to the text actor. On that actor do: if attribute (arrow pressed) is true, change image to (invis), else: change image to (whatever the text image is called).
If you want the text to disappear forever, then instead of changing the image on text actor, just destroy it.
I hope this helped. Tell me if you need pictures.