[Solved]How do I anchor to camera view.

  • Hi I'm trying to create a HUD for a sidescroller but I can't figure out how to anchor my life bar to the top left corner view of my camera, I've tried the anchor behavior but through debugging it looks like it's anchoring to the top left of my whole layout.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Isn't anchor always relative to the viewport?

    Would be wise though to put the anchored object on a layer with 0,0 paralax..

  • make sure you are putting your hud objects on a layer with parallax of 0,0 so that it doesnt more and ensure you put it inside the dotted window in your layout view

  • Isn't anchor always relative to the viewport?

    Would be wise though to put the anchored object on a layer with 0,0 paralax..

    It's in it's own layer with a 0,0 paralax but it doesn't show up, according to debug it's just sitting at 736, 736 no matter where the camera moves. Even if I go to 736, 736 I can't see it but debug says visible is true.

    edit: My camera follows my player so original position in my layout shouldn't matter, correct?

    edit2: thanks! I got it working apparently position does matter the anchor keeps it in relation to where it is in the original viewport layout, so I need it in the top left of the dotted lines no matter what my actual view is doing.

  • You need to put the anchored object within the dotted line area which I think are called margins.

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