Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | vspin |
I want my entire map in my 2D game world to be able to be scrolled with inertial scrolling. Any suggestions to accomplish this?
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | vspin |
I want my entire map in my 2D game world to be able to be scrolled with inertial scrolling. Any suggestions to accomplish this?
Reply From: | Bartosz |
Start with simple dragging for scroll effect e.g. map is scrolled only when you touch screen or are pressing mouse button
modify your script to instead of actual dragging gave your map a speed that depends on how far user was trying to drag (map should run out from the screen)
add friction to your map movement e.g. in each frame decrease its speed
you’ve got yourself inertial scroll