Dragging the Screen with Mouse and Touch

6
  • 58 favourites

Index

Stats

9,021 visits, 25,446 views

Translations

This tutorial hasn't been translated.

Tools

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.

  • 3 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!

  • Thanks heaps! worked a treat