How do I maintain HUD/UI position when shifting camera zones

Get help using Construct 2

Post » Thu Feb 19, 2015 2:27 pm

I'll try to describe this as accurately and simple as possible:

The Player moves around "Zones" where the camera scrolls to and focuses based on what zone the player is in. (ex: Mega Man, Castelvania, Older Top-down Zeldas, Binding of Isaac etc.)

The camera moves fine, but I don't know how to make the player's selection menu hud move when the camera shifts, and here's why:

The menu consists of these elements: A sprite background image, and 8 individual text objects.

When I attempted this, I used the camera zone sprites (which work as "Every Tick->is Player overlapping Zone->Scroll to Zone) and placed a new image point on those camera zone sprites. I then tried "Every Tick->is Player overlapping Zone->Set MenuBackground to Zone (image point 1)" and it worked find for the menu background.

However, when I tried to do the same for the text objects (which I put into a family), All the text objects would be smashed together. I know this is because it's telling all the text objects to move to the same image point.

I need to be able to move all the text objects to the active "Zone", while still keeping it's position relative to the screen. How can I achieve this?
B
18
S
4
Posts: 104
Reputation: 1,315

Post » Thu Feb 19, 2015 3:32 pm

Figured it out-

The very complicated solution is:

Anchor behavior.
B
18
S
4
Posts: 104
Reputation: 1,315

Post » Thu Feb 19, 2015 3:38 pm

Couldn't you just use a UI layer with parallax attribute set to 0,0 ?
So it will always follow the camera
B
12
S
7
G
7
Posts: 448
Reputation: 4,272

Post » Fri Feb 20, 2015 2:51 am

That works too but I think Anchor is good if you want to keep aspect ratio scaling in mind.
B
18
S
4
Posts: 104
Reputation: 1,315


Return to How do I....?

Who is online

Users browsing this forum: alajajm, Draconiz717, Fenix18, GlassCanon1993 and 6 guests