Scrolling layers manually/independently?

0 favourites
  • 3 posts
From the Asset Store
Change the size and position of everything without calculating anything!
  • 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.

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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".

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