Login / Registrieren
DE EN FR ES IT CZ
Zurück Nach oben

Scroll scene by dragging

  • #1, by dramamini 11 years ago Zitieren
    Hi guys!!

    1. I have a big map as background image in a scene. Is it possible to scroll scene at any direction by dragging the map (using mouse or by hand on android version)?

    2. Is it possible to start a scene at a specific given position (for example in the middle of a big map) whithout the scroll effect at the beggining?
  • #2, by afrlme 11 years ago Zitieren
    1. There's a checkbox option in each scene' properties tab: scroll scene if the cursor is at screen edge. If you tick that then the screen will scroll whenever the mouse enters the scroll borders at the edge of the current viewport.

    2. Sure, but you have to disable character centering. You will have to re-enable character centering when you want to make the camera automatically follow the character again.

    a. scene > center scene on character permanently > select character (tick clear centering checkbox)

    b. now you can define a scroll position without it scrolling by creating an execute a script action part containing...
    game.ScrollPosition = {x = 0, y = 0} -- replace 0, 0 with coordinates you want to set scroll position to.
    


    To re-enable camera follow character, you just have to follow step A, but leave the clear centering checkbox unchecked.
  • #3, by dramamini 11 years ago Zitieren
    1. Yes, I know, but I was wondering if there is a way while pressing the mouse button to drag the whole scene at mouse direction...

    2. Thanks! I'll try it!
  • #4, by afrlme 11 years ago Zitieren
    Hmm I suppose it would be possible. I suppose you could store initial value of mouse cursor & scene scroll position into variables, then create a loop & have it offset position by distance mouse has moved towards or away from mouse depending on whether you want to inverse axis etc.

    Will have to think about it. My head's a bit bleh, at the minute.