Disable ScrollTo Behavior

Get help using Construct 2

Post » Wed Aug 01, 2012 4:07 pm

I would like to disable the ScrollTo Behavior during game play for a certain timeframe and then enabled it again. Is this possible?
B
17
S
9
G
7
Posts: 249
Reputation: 6,922

Post » Wed Aug 01, 2012 4:10 pm

Use the system scrolling events instead of the behaviour and you can do whatever you want with the scrolling.
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Wed Aug 01, 2012 5:47 pm

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.
B
17
S
9
G
7
Posts: 249
Reputation: 6,922

Post » Wed Aug 01, 2012 6:15 pm

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.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Wed Aug 01, 2012 6:26 pm

@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.
B
17
S
9
G
7
Posts: 249
Reputation: 6,922

Post » Wed Aug 01, 2012 6:30 pm

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)
B
48
S
15
G
6
Posts: 795
Reputation: 12,035

Post » Wed Aug 01, 2012 7:24 pm

@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.
B
17
S
9
G
7
Posts: 249
Reputation: 6,922

Post » Thu Aug 02, 2012 2:56 am

i wish ^^
B
48
S
15
G
6
Posts: 795
Reputation: 12,035


Return to How do I....?

Who is online

Users browsing this forum: BipolarMike, totoe and 23 guests