Scrolling problems

This forum is currently in read-only mode.
From the Asset Store
Change the size and position of everything without calculating anything!
  • I need some help...

    I going to make a scrolling system like this:

    If mouse x position is equal to screens x position

    then screen going to move screens x position + 10 px

    and if mouse y position is equal to screens y position

    then screen going to move screens y position + 10 px

    I tried, but can't understand how i gonna do it...

    I hope you can help me.

  • For scrolling to the right:

    New event - System - compare. So then you can compare the two values: "Get mouse X" and "Get X right of visible screen". Which will check if the mouse is on the right edge of the screen.

    action - system - scroll to X. Then you want to retrieve the current "Get scroll X" then add 10 to it.

    and you'll end up with this:

    <img src="http://dl.getdropbox.com/u/1024727/images/code1.JPG">

    however I made it so that if your mouse is within 10 pixels of the right edge, by checking if the mouse is greater than right edge -10 pixels - because it's too annoying to try and get the mouse to exactly the right edge.

    <img src="http://dl.getdropbox.com/u/1024727/images/code2.JPG">

  • Try using the Follow Mouse behavior on a sprite and centering the screen on that sprite or however you intend to do your scrolling base it off that sprite (you can make it invisible or part of the GUI.) Though you'll need to work out a system of adjusting the speed, you know how with the WII remote it wasn't a 1:1 ratio. That may just have been what I was trying to do with the Mouse behavior when I tried it out though.

    I keep saying sprite, but a tiled background should work just as well for most stuff.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks, It worked

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