How do I keep a drawing canvas overlaid on a viewport?

0 favourites
  • 2 posts
From the Asset Store
Pixel Destruction like in "Worms" (Drawing Canvas based)
  • Hi

    I have a vertically scrolling game, and I am using a Drawing Canvas on its own layer to draw lines based on TouchX and TouchY. It seems when my game scrolls upwards, I obviously need to keep the drawing canvas overlaid on top of the viewport, as my game currently scrolls beyond the drawing canvas and the drawing gets clipped.

    I have tried turning off parallax, so it just remains in place, but this doesn't work either.

    What is the approach to maintain the drawing canvas overlaid over the viewport, and still be able to interpret touch coordinates etc.

    I think the answer is to turn off parallax on the drawing canvas, but use the ViewPortTop value somehow to manipulate any Touch Y co-ordinates. I am assuming Touch.X and Touch.Y are physical device co-ordinates (viewport) - or are they world X-Y coords?



  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • you might want to look touch.x(index) not just touch.x. The coordinates are for that index layer.

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