How do I pin the hud to all layouts?

Get help using Construct 2

Post » Sun Feb 14, 2016 3:22 pm

Hey guys :D. I have a problem like this: I made a HUD as a layer but it shows only at 1 layout. Is there any way to copy it and paste to the other layout? I don't want to create HUD from the beggining for every layout XD.
Thanks for the help :D
B
4
Posts: 15
Reputation: 230

Post » Sun Feb 14, 2016 3:36 pm

Layers have a property called "Global" that you can set.
If you do so, it will be in every layout, and you don't need to copy. There are a few things to be careful about, so best check the global-layer-section of the manual, too.
B
78
S
28
G
32
Posts: 481
Reputation: 19,788

Post » Sun Feb 14, 2016 3:50 pm

Ok I got it :D. Thanks :D
B
4
Posts: 15
Reputation: 230

Post » Sat Feb 20, 2016 5:42 pm

Hey, it's me again :D. I have a next problem XD. When next layout starts, the HUD is getting back to it's first state before 1st level. I mean the all collected points and all lost lifes are missing. How can i fix it?
B
4
Posts: 15
Reputation: 230

Post » Sat Feb 20, 2016 5:45 pm

Keep your points and lives information in a global variable or array.
Mistakes were made.
B
53
S
27
G
114
Posts: 1,695
Reputation: 64,438

Post » Sat Feb 20, 2016 9:07 pm

How am I suppose to do this? I set points and life as main character's instance varribles.
B
4
Posts: 15
Reputation: 230

Post » Sat Feb 20, 2016 9:21 pm

You can:

1. Set points and life as global variable instead of instance variable (right click on event sheet - add global variable)

2. Copy the player instance variables to the global variable when changing layouts, and copy them back at the beginning of next layout.

2. Add Persist behavior to main character sprite. Not sure if this actually works, as it is meant for saving the object when you go to the previous layout.
Mistakes were made.
B
53
S
27
G
114
Posts: 1,695
Reputation: 64,438


Return to How do I....?

Who is online

Users browsing this forum: Psynaptik and 8 guests