Disable ScrollTo Behavior

0 favourites
  • 8 posts
From the Asset Store
TNT Tap Arcade Game
$3.20 USD
60% off
Quickly disable all TNT barrels or everyone will be in danger!
  • I would like to disable the ScrollTo Behavior during game play for a certain timeframe and then enabled it again. Is this possible?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Use the system scrolling events instead of the behaviour and you can do whatever you want with the scrolling.

  • I would rather create a custom scrollto behavior that would allow it to be disabled and Enabled during runtime. After looking at the code it would be really simple to do. I just wouldn't include the shake action.

  • How do I FAQ, section "Scrolling / camera".

    There is a Delayed/controlable camera example.

    Also the ScrollTo behavior just uses the system scrolling expression Nimtrix mentioned.

    If you want to enable/disable it, just put it in a group.

    But you're kind of trying to reinvent the wheel.

  • Kyatric

    Well i just reinvented the wheel(more like copy the contents of the tick2 function minus the shake code) and put in the ability to disable and enable. I also added the option to scroll just in the X and Y direction or both.

    The reason i wanted to do this is i have a platform like game where a object jumps based on pressing right and left keys. The longer you press the keys, the more energy gets store for a longer jump. During this charge time the object shakes. This shaking was making the whole screen shake when using the default scrollto behavior. so after looking at the code, it was just as easy to make a modified version then to do it with a group.

  • i wish there disable and enable on scrollto , in the scrolling camera events has some stuffs that i couldn't fix it , for example if i made the game scroll only on x of the player.x it follows the player.x but when the player die it get bug... same on y . also i tried to put another object thats follow player but same bug comes...

    the bug is that the object or camera moves to the least point of layout.x then back to player (0)

  • zsangerous

    So are you saying you would like to use the modified behavior. If so i will clean up the code and call it something other then "myscroll" which is what i called it.

    let me know.

  • i wish ^^

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)