About layers?

StoneclipseStoneclipse Member, PRO Posts: 130
edited July 2012 in Working with GS (Mac)
Well, i have a pause button on my scene. And my game allows user to tap anywhere on the screen to spawn an actor, however when i hit the pause button, i don't want it to spawn the actor. But now when i press the pause button, it will still spawn an actor behind the pause button. What can i do to correct this?

Best Answer

  • tatiangtatiang Posts: 11,949
    Accepted Answer
    If you use the When Mouse Button is Down rule, it will be true whenever the person taps anywhere on the scene, including on the pause button actor.

    One way to avoid this is to check how long the player is tapping for and set a rule condition for the pause button that only runs if the tap is a long one (tap and hold). Another way is to force the player to use more than one finger to pause (e.g. "Tap to spawn, three fingers to pause") and use the game.touches.count attribute in your rule condition. A third way is to make a scene-sized actor that is transparent (e.g. Change Attribute self.color.alpha to 0) with a When Touch is Pressed rule instead of the When Mouse Button is Down rule.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Answers

Sign In or Register to comment.