Scroll To behaviour and layout corners

0 favourites
  • 6 posts
From the Asset Store
All popular touch mechanics - scrolling, zooming, swiping
  • 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.

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks, I've figured that out, but unbounded scrolling presents another problem, as I've stated before.

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

  • I just added two new behaviours to deal with this.

    Bound to layout Plus, Scroll To Plus

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

    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.

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