Parralax Scrolling and touch

0 favourites
  • 5 posts
From the Asset Store
Classic style beat'em up template. Punch & Kick foes across the screen.
  • I'm trying to create an analog stick that works with touch screen devices. An issue I can't seem to get around though is the scrolling motion.

    In the version I have uploaded, the stick is moved on the HUD layer, when the users touches the HUD the stick moves to the touched position. (This also works with mouse)

    When I start the game in full screen (Scale) and click, the analog doesn't position itself correctly, its almost as if the parallax has failed.

    Any help to why this is happening would be greatly appreciated.

    Capx

    dl.dropbox.com/u/74175978/Test_Parralax_Touch.capx

  • I've tried a few things out.

    If I set the full screen to crop the touch device works as expected

    If I set the full screen to anything else then it seems the touch device isn't pointing where I click.

    I have tried playing with the scale rates with no success. Any help would be greatly appreciated

  • Having no luck here, testing everything from scale rates, to moving the objects to different layers.

    I worked out it has something to do with the full screen and touching the a layer with 0,0 parallax. Its as if the screen warps itself on a different parallax.

    If you download the capx, just click anywhere and you'll see what I mean

  • Richard, instead of using Touch.AbsoluteX and Touch.AbsoluteY, have you tried using Touch.X("HUD") and Touch.Y("HUD")? These give you X and Y co-ords that are adjusted for the scale, parallax, etc. of the specified layer ("HUD" in this case?

    Here is a capx that works (I think)

    Docs on the touch object including the Touch.X("Layer") and Touch.Y("Layer") functions can be found here.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • BStateham

    Works perfectly now, I've read through the touch documents 100 times yesterday pulling my hair out for how to restrict touch to the touch layer. Don't know how I missed it.

    Thanks for the advice

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