Scroll To behaviour and layout corners

Get help using Construct 2

Post » Thu Aug 01, 2013 4:04 pm

Hello everyone,
I've encountered a problem in using Scroll To behaviour attached to player character to simulate a screen shake - when it activates near the layout's corner, screen won't shake. Unbounded scrolling seems to help, but it makes the area outside the playable zone visible, effectively creating an "invisible wall", and I can't yet figure out how to solve the problem.
B
10
S
1
Posts: 54
Reputation: 958

Post » Thu Aug 01, 2013 6:06 pm

The shake function scrolls the layout very fast in different directions, if you are near the edge it cant shake because there is no room to scroll. Thats why when you choose unbouned scrolling it works, because there is infinite room, to scroll.
B
10
S
4
Posts: 133
Reputation: 1,543

Post » Sun Aug 04, 2013 9:36 am

Thanks, I've figured that out, but unbounded scrolling presents another problem, as I've stated before.
B
10
S
1
Posts: 54
Reputation: 958

Post » Mon Aug 05, 2013 4:05 am

When not shaking you can simulate bounded with something like this:

set scrollx to clamp(scrollx, screenwidth/2, layoutwidth-screenwidth/2)
set scrolly to clamp(scrolly, screenheight/2, layoutheight-screenheight/2)

I didn't verify the expression names but the idea should be sound.
B
94
S
33
G
117
Posts: 5,390
Reputation: 75,341

Post » Mon Aug 05, 2013 4:32 am

I just added two new behaviours to deal with this.
Bound to layout Plus, Scroll To Plusblackhornet2013-08-05 04:33:00
ImageImageImage
B
71
S
22
G
257
Posts: 3,789
Reputation: 142,694

Post » Thu Aug 08, 2013 4:06 pm

[QUOTE=R0J0hound] When not shaking you can simulate bounded with something like this:

set scrollx to clamp(scrollx, screenwidth/2, layoutwidth-screenwidth/2)
set scrolly to clamp(scrolly, screenheight/2, layoutheight-screenheight/2)

I didn't verify the expression names but the idea should be sound.[/QUOTE]

I'm not entirely sure how to do this. For now I simply use the Scroll To behaviour to center the camera on the player and to simulate shaking.Niko2013-08-08 16:30:41
B
10
S
1
Posts: 54
Reputation: 958


Return to How do I....?

Who is online

Users browsing this forum: WesleyDeveloper9 and 1 guest