Scrolling the camera down

Get help using Construct 2

Post » Wed Apr 10, 2013 3:35 pm

I've been trying to structure events that will make the camera slowly scroll down the screen at the start of the layout.

So the camera begins at (0,0) for instance, and will smoothly scroll down the screen until it reaches the bottom of the layout.

I've tried a variety of things, and for some reason when I do

At start of layout -> Scroll to (0,0)

and then something like every 5 seconds, scroll y to current y -5. It does nothing besides the initial Scroll to (0,0)

I've read all the tutorials and looked at the .capx's for scrolling in the FAQ, but they all pertain to things much more complicated than this. This should be very simple, I just can't seem to make it work.

Any help?spartyon2013-04-10 15:38:46
B
5
S
1
G
1
Posts: 28
Reputation: 615

Post » Wed Apr 10, 2013 4:18 pm

I dont know if it's the best solution, but what i do to move the camera is :

Create a sprite called "cameraTarget" for exemple
Make it invisible
Apply the behavior "scroll to" on this sprite so the camera will always follow it
Move the sprite down (i would use the bullet behavior in your case)Mimiste2013-04-10 16:19:00
B
12
S
3
G
4
Posts: 63
Reputation: 3,410

Post » Wed Apr 10, 2013 4:49 pm

If there isn't a more elegant way that is probably how I'll end up doing it. Thank you.
B
5
S
1
G
1
Posts: 28
Reputation: 615

Post » Wed Apr 10, 2013 5:03 pm

You're not nesting the scroll action in the "at start of layout" condition, right? If so, it'll only fire once and not every tick.

This works fine for me:




Edit: I just reread your post.
[quote=spartyon] then something like every 5 seconds, scroll y to current y -5[/quote]

To scroll down, you need to add to ScrollY. Subtracting will try and scroll up.zatyka2013-04-10 17:09:35
B
44
S
13
G
7
Posts: 338
Reputation: 10,379

Post » Wed Apr 10, 2013 5:18 pm

For some reason that does not work for me, zatyka.

It has no effect on the camera.
B
5
S
1
G
1
Posts: 28
Reputation: 615

Post » Wed Apr 10, 2013 5:49 pm

@spartyon. It works fine. You have to make an object or background to check if the camera scrolling. If you put empty layout and add the event given by zatyaka, you wont notice the camera scrolling down.
B
41
S
9
G
4
Posts: 100
Reputation: 6,211

Post » Wed Apr 10, 2013 5:57 pm

Yes also make sure your layout is bigger than the window size and you don't have ScrollTo behavior on an object.
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,000


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, mallorcaredes and 3 guests