Dragging the Screen with Mouse and Touch

9
  • 61 favourites

Index

Stats

11,114 visits, 29,664 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Dragging the Screen - Touch

Touch dragging works almost the same as with a mouse with one major difference. You need to repeat the above steps but replace all the Mouse.Absolute with Touch.Absolute and rather than Left mouse click events you will need Touch, Is In Touch events so you have:

but this will not work as you need to make one change. You need to set the DragMouseX and Y variables once Touch starts and not all the time Touch is in use. So, add an event On Any Touch Start and move the DragMouseX and Y actions to it so you have:

This should now work, you can touch the screen and drag the level around.

Finally. if there is anything you need to click on and NOT drag the screen while you do so, you can just add another condition to the Is In Touch or On Left Button Clicked events to give you the following:

For Mouse:

For Touch:

I hope this helps you as much as it did me.

  • 4 Comments

  • Order by
Want to leave a comment? Login or Register an account!
  • Is there a modification to the expression that can take layoutScale into account? If the scale is anything other than 1 this system breaks. I've been trying to figure this out to no avail. Your tutorial is great BTW! Cheers!

  • Thank you very much!

  • Thanks heaps! worked a treat