[Solved]How do I anchor to camera view.

Get help using Construct 2

Post » Thu May 14, 2015 7:09 pm

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.
Last edited by chris200x9 on Thu May 14, 2015 7:50 pm, edited 1 time in total.
B
15
S
7
G
1
Posts: 34
Reputation: 1,793

Post » Thu May 14, 2015 7:22 pm

Isn't anchor always relative to the viewport?

Would be wise though to put the anchored object on a layer with 0,0 paralax..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu May 14, 2015 7:40 pm

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
B
42
S
17
G
2
Posts: 850
Reputation: 6,209

Post » Thu May 14, 2015 7:42 pm

LittleStain wrote: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.
B
15
S
7
G
1
Posts: 34
Reputation: 1,793

Post » Thu May 14, 2015 8:32 pm

You need to put the anchored object within the dotted line area which I think are called margins.
B
8
S
1
Posts: 39
Reputation: 536


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 9 guests