playMaker

Author Topic: How to scroll an image vertically (clamped to the image's top and bottom)?  (Read 142 times)

SuperVerity64

  • Playmaker Newbie
  • *
  • Posts: 1
Hi!

I've been working on this one scene for about a week solid and haven't made much progress, so I'm hoping someone can help! I've been through this forum and have done much Googling but nothing I've found is really working for me :'(

The scene is basically the player scrolling vertically on a phone screen by clicking and dragging the mouse - currently I have the screen as one asset, and the phone 'frame' as a second asset.

So far, I have managed to get the screen image (currently set up as a sprite) to move vertically on mouse down by setting up a state with 'get mouse y' and 'set position 2d' - this allows the content to be moved on the y-axis, however the image snaps to wherever the mouse is when it's clicked, rather than actually scrolling! The movement of the image also isn't locked to its top or bottom. I have tried to use Scroll View with UI elements as well as my current setup with PM, but it's just not happening :'(

So basically, two issues:
1. Scrolling an image on mouse down without its position snapping to the mouse;
2. Locking the scrolling to the top and bottom edges of the image so the player can't over-scroll.

I'm very much a beginner to both PM and any kind of scripting, so if anyone can help me with this by just telling me straight what actions/events I should be using to get this to work, I'd really appreciate it!

Thanks in advance :)