Bound to layout on scale

0 favourites
  • 2 posts
  • I have a draggable object in my game, and the object has the behavior 'Bound to layout' making it stay on screen when dragging over the edges.

    I want my game to support multiple screen sizes and portable devices, so I've set the background layer to parallax(0,0) and added the anchor behavior (so that the background stretches over the whole screen when fullsized in scale mode). I also have some HUD buttons in each corner, anchored so that they stay in the corners when resizing/scaling.

    However, the layout itself isn't stretched over the screen, so the draggable object is still bounded the the small layout (see image below, the blue area).

    <img src="" border="0" />

    The red draggable object is bound to the blue area, but I would like it to be draggable over the whole screen (blue+green) but still be bounded by the edges.

    I've tried adding solid edges manually, but then the draggable object would 'jump' over the edges when moving the mouse outside the edges, making the object disappear outside the screen.

    What is the best way to make the draggable object bound to the screen? Something that works when the game is scaled.

    Thank you!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have tried different methods to make this work the way I want, but still no luck... does anyone know how this can be done? Or if it's even possible..?

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