Scrolling Left to Right - Unintuitive, please help?

JoeBJoeB Member Posts: 160

I want the player to be able to scroll sideways using their finger. Right now I have a an actor that is constrained to touch X and that actor controls the camera, and it works well enough but the motion is currently unintuitive. Regularly when you swipe your finger to the right in a phone or tablet you'd expect the screen to move left, however in my app it currently moves to the right.

I don't know how to do it so that swiping right actually creates a leftward scrolling motion. Anyone? Please help, thank you.

Comments

  • JoeBJoeB Member Posts: 160

    I think it has to do something regarding the delta but I do not know how to factor that into my expression

  • SocksSocks London, UK.Member Posts: 12,822

    @JoeB said:
    I think it has to do something regarding the delta but I do not know how to factor that into my expression

    You have an expression you would like us to help you with ?

  • JoeBJoeB Member Posts: 160

    @Socks Yes, this is based upon a post by @RThurman i read on the forums.

    I have an self.offset attribute

    When actor is pressed,
    Change attribute self.offset to self.Position.X - game.Touches.Touch 1.X
    Constrain attribute self.Position.X to game.Touches.Touch 1.X + self.Offset

    It works smoothly but the swiping motion goes the wrong way

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880

    Give this a try. It controls the camera's origin directly through an unlocked instance actor.

  • JoeBJoeB Member Posts: 160

    That did the thing! Thanks a lot :D

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880

    You are welcome!

Sign In or Register to comment.