Restrict Swiping to a Specific Page in a Game Section

  1. 3 weeks ago

    I have a scenario where I want to jump from one page to a game page related to the content. While on this game page, the user should only be able to return to the original page—not navigate to any other pages via swiping.

    However, I still want to keep swipe navigation enabled for the rest of the project. Is there a way to disable swiping only on this specific page while maintaining it elsewhere? Or a different way to do what I'm trying to achieve?

  2. 2 weeks ago

    No answer? :(

  3. Angelo S

    Mar 12 Administrator

    place a gesture recognizer underneath every other object in the game page

  4. Hi Angelo,
    I'm not sure I understand. By "gesture recognizer" you mean something like an interactive area? And then what? I know I can disable page swipe in the project level and then manually add swipe left/right events on all the pages but the game page, but in this case I loose the nice page swipe animation.
    But you suggest to add it only in the game page? Doing what? thanks!

  5. Angelo S

    Mar 12 Administrator

    Leave page swiping ON on a project level. In the game page, add an interactive area that covers the whole page, below every other object, and make sure "Always Catch Events" is enabled on the interactive area. This will intercept swipes before they get to the page, thus preventing page swiping, only in the game page

  6. I followed your suggestion and added a full-page interactive area. I wasn't clear on the 'below every other object' part, but I tried both placing it on the top and bottom layers. Neither worked. Page swiping is still active (tested on Android).

  7. ok, I played with it a bit, and found that only if I add swipe left and swipe right events (I added "show object - self" for the interactive area, which does nothing), then swipe is actually blocked.
    For some reason, though, it takes a second until it becomes active. If I swipe right when the page appears, it will swipe. A second later, it will not.

  8. Angelo S

    Mar 12 Administrator

    are you sure "Always Catch Events" is enabled on the interactive area?

  9. Of course. But as I wrote, now it works

 

or Sign Up to reply!