Faking a touch?

AshumBesherAshumBesher Member, PRO Posts: 121

I'm half way through making my newest game, I have some on-screen buttons all with "when touch is pressed" rules and they all work fine. I'm using the "pause" feature to have pop-up tutorials saying how to use the buttons. When in the "paused" state, I've made it so pressing anywhere on the screen will resume the game, that's all fine and works. What I also want though is when in the "paused" state, if you press on the button on the game scene which is visible under the pause layer, I want that button to take affect and also unpause in one touch. That doesn't seem possible however, so I wondered are there any rules which will make a specific part of the screen think it's been touched when it physically hasn't? I mean so that the "when touch is pressed" rule will take affect without actually touching the screen. That would help me accomplish what I want without me having to edit every single button rule on 20ish scenes individually.

Comments

  • bob loblawbob loblaw Member, PRO Posts: 793

    probably not using pause screens, not that i know of, anyway.

    to do what your saying, you’d probably need to go the route of a pause action on every actor on the live screen, then a “mask” actor to cover the screen when that pause behaviour is activated, rather than the go to pause screen.

  • Two.ETwo.E Member Posts: 599

    One possible solution (maybe):

    Create Game.Attribute called Pause (value = 0).

    When you Unpause the game. Change this attribute to 1. After 0.1 seconds. Change attribute to 0.

    In all your buttons. Have a rule that checks the following:

    If Attribute.Pause = 1
    If Touch is Inside Actor

    Do ACTION.

    NOTE: I can't test this at the moment. Might have to check if touch is inside by comparing self.position with Touch.Position.

    Best,
    Two.E

  • AshumBesherAshumBesher Member, PRO Posts: 121

    Turns out what I thought was a problem wasn't a problem after all. It worked as I wanted on my phone, just not in the Windows Creator.

    Thanks both of you for your help anyway :)

Sign In or Register to comment.