How to limit panning to the edges of viewport (left or right of screen)? Please need urgent help.

0 favourites
  • 11 posts
From the Asset Store
A complete set of graphical user interface (GUI) to build 2D video games. With wood, nature, & jungle theme
  • Hi Friends,

    There is a touch panning example in construct 2. I need urgent help where I need that when image is max visible at right then no more panning should be availalble. This will avoid user seeing blank white areas after image on left or right of screen.

    Please help me.

    Thanks

  • Click on the layout and set 'Unbounded scrolling' to 'No'.

  • Click on the layout and set 'Unbounded scrolling' to 'No'.

    This stops panning completely. cant do this.

  • Enlarge the layout. When the screen already shows the whole layout panning makes no sense.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Enlarge the layout. When the screen already shows the whole layout panning makes no sense.

    I have created a sniper shooting game and when user sees through scope, I need panning to be activated and stopped at the edges.

    I have already created this game.

    Minor glitches are there but enjoyed developing it using construct 2. Try it here.

    bit.ly/affleeq2

    After playing it hopefully you can understand my requirement. Currently The issue I am facing on going extreme right after zooming is not working correct (max area is not reachable though works fine in non zoomed mode)

    Any suggestion?

    And this is my best game ever made from construct 2 felt like playing on console ...heee kinda weird praising myself but feeling proud.

  • I suspect that this is caused by parallaxing. If so, check if it is really necessary to use parallaxing on these layers.

  • I suspect that this is caused by parallaxing. If so, check if it is really necessary to use parallaxing on these layers.

    Parallaxing is available only on panning bg layer other layers have no parallax. and I am using construct 2 panning example as it is for achieving this.

    left side movement is good even in zoom also but right one has issue.

  • In the game from your link i have this issue on both sides, left and right. I tried it with the panning template and the way i did it, i reach further to the edge with zooming in. Easiest way to solve this issue would be to enlarge the layout and let the enemy never patrol near the edge of the layout, so the player can target them with any zoom.

    1drv.ms/u/s!Ap_-qxoGKbDcg3ZgIxempTFnmK1M

  • In the game from your link i have this issue on both sides, left and right. I tried it with the panning template and the way i did it, i reach further to the edge with zooming in. Easiest way to solve this issue would be to enlarge the layout and let the enemy never patrol near the edge of the layout, so the player can target them with any zoom.

    https://1drv.ms/u/s!Ap_-qxoGKbDcg3ZgIxempTFnmK1M

    Thanks for the Capx. It really helped me. One issue I am facing that on PC we use mouse so zoom slider is not an issue but on mobiles we using touch so moving slider completely changes the position of game bcz touch point is stored by layer UI. I moved zoom slider layer to top of the game then also it doesn't go smooth. Can we make one layer block touch of below layer, for ex. Zoom layer on top when touched to slide then UI layer touch points stay unaffected and scope zoom (actually layer scaling) works perfectly.

    Any solution for zoom slider will help me understand a lot.

    Thanks & really thankyou for your help.

  • It is worth considering whether it would be better to use buttons instead of a slidebar.

    I have created an example with buttons and slidebar. Since I'm on the road, I had to use C3. Please take a look at it with the free version: editor.construct.net

    File: 1drv.ms/u/s!Ap_-qxoGKbDcg3u0k6CcY380HdYc

    It is fully compatible with C2. I could not test whether Multitouch works without error.

  • It is worth considering whether it would be better to use buttons instead of a slidebar.

    I have created an example with buttons and slidebar. Since I'm on the road, I had to use C3. Please take a look at it with the free version: editor.construct.net

    File: 1drv.ms/u/s!Ap_-qxoGKbDcg3u0k6CcY380HdYc

    It is fully compatible with C2. I could not test whether Multitouch works without error.

    Thanks a lot Kriand for giving time even when you were travelling. It is working lot n lot better than my version. Lot of thanks to you and ur suggestion helped.

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