How do I keep an object at the X/Y of a layer which has a different scale rate?

0 favourites
  • 3 posts
From the Asset Store
Adjusting the game screen for different resolutions (Letterbox scale)
  • Hey all, I have a little issue I need some help with. I have a layer for text boxes that has a scale rate of 0%, and the rest of the layout scales normally. This is because I want to play around a lot with the camera and zooming, but I want the text to always appear at the same size.

    The issue is that the X/Y for the text boxes is off, because I want them to be created according to the X/Y in other layers. I tried messing around with it a bit but I get a bunch a okay-ish to extremely quirky results.

    So I want to be able to create an object on a layer with a scale rate of 0%, but have that object an X/Y position on a layer with a scale rate of 100%, and to remain at that position even if the camera moves.

    Thanks in advance!

  • To convert from layer A to B:

    X = CanvasToLayerX("B", LayerToCanvasX("A", x, y), LayerToCanvasY("A", x, y))

    Y = CanvasToLayerY("B", LayerToCanvasX("A", x, y), LayerToCanvasY("A", x, y))

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • To convert from layer A to B:

    X = CanvasToLayerX("B", LayerToCanvasX("A", x, y), LayerToCanvasY("A", x, y))

    Y = CanvasToLayerY("B", LayerToCanvasX("A", x, y), LayerToCanvasY("A", x, y))

    Thanks mate! Working well :)

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