Scrolling layers manually/independently?

Get help using Construct 2

Post » Sun Jul 19, 2015 4:04 pm

I'm about to reprogram all the scrolling in my game to allow for arbitrary independent scrolling of individual layers.

The workaround I came up with is kind of ugly and unintuitive to work with, so before I start I figured I'd ask if there's any built in C2 feature, or plugin, that already does this, that I might be overlooking.

I've looked around the system object and manual for a while now, and to my knowledge the only layer parallax related thing you can adjust at runtime is the layer's parallax percentage.

The workaround I came up with is to set the global scroll position to (-100, -100), never move it, and then I can set the scroll position of individual layers independently by setting their scroll percentage to the number of pixels I want to offset them by X and Y.

It's ugly, and it makes the code harder to understand at a glance, but it does work. From there I can recreate the basic global scrolling behavior C2 normally does, but with the benefit that, for the few layers I need to scroll in slightly more specialized ways, I can use any formula or logic I want.

Any suggestions are welcome. :)
B
26
S
17
G
8
Posts: 323
Reputation: 6,021

Post » Mon Jul 20, 2015 5:46 am

Well, I don't think it's precisely what you're after but you can try the Scroll effect by Somebody (towards the bottom of the first post). Though if this project is something for mobile it may not work.
B
49
S
23
G
17
Posts: 291
Reputation: 12,407

Post » Thu Jul 23, 2015 3:27 pm

Hey, Sup with that? :)

Thanks for the reply. Unfortunately an effect isn't quite what I'm looking for, as effect's to my knowledge, can only affect imagery that is rendered within the screen boundary.
On an unrelated note, there's something kind of surreal about having "Sup with that?" recommend "Somebody". :D
B
26
S
17
G
8
Posts: 323
Reputation: 6,021


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 1 guest