Scrolling on Device Border
Monkey Forums/Monkey Programming/Scrolling on Device Border
| ||
Hi, i have a Large image and i want to scroll if the Mouse gets on the Border. Can Someone give me a Start? Thought something about Setting vars for disPlay Resolution and Map Resolution and then Move the Device vars on the Large Map, but As i Said im unsure. any help would Be Great thx in advice |
| ||
Field ScreenSizeX:Int = DeviceWidth() Field ScreenSizeY:Int = DeviceHeight() Field OffsetX:Int Field OffsetY:Int Method OnCreate() OffsetX = ScreenSizeX OffsetY = ScreenSizeY End Method ScrollX(x:Float) If (x > 0) OffsetX = OffsetX + 1 ElseIf (x<0) OffsetX = OffsetX - 1 End End Method ScrollY(x:Float) If (x > 0) OffsetY = OffsetY + 1 ElseIf (x<0) OffsetY = OffsetY - 1 End End On Start Offset = DeviceSize And then draw everything on the OffsetVariable Position? |
| ||
Ok got it working, i added all Images in an Imagelist and moved them by the offset. To get Parallax working, just divide the offset as closer as you get to the background layer. |