GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Scrolling Left to Right - Unintuitive, please help?

JoeBJoeB Posts: 160Member

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 Posts: 160Member

    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.Posts: 12,822Member

    @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 Posts: 160Member

    @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 Posts: 2,824Member, Sous Chef, PRO

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

  • JoeBJoeB Posts: 160Member

    That did the thing! Thanks a lot :D

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

    You are welcome!

Sign In or Register to comment.