my UI disappears when i set parallax to 0

Get help using Construct 2

Post » Tue Jun 05, 2012 2:08 am

Pretty much what you read in the title, I made a health bar and I want it to be visible on the screen all the time but when I set the layer's parallax to 0,0 it just disappears, not visible anywhere. I set it to 100,100 and there it is again... any help please?
B
5
Posts: 2
Reputation: 654

Post » Tue Jun 05, 2012 2:40 am

You should create a layer on the top called GUI (have the parallax set to 0,0) and set your health bar graphics layer to the GUI layer.

Edit: Also, I can create a tutorial for creating a dyanmic HP bar if you like. My project's HP/MP meters works in that fashion and has the "bar/meter" part overlaid on a border graphic.LaDestitute2012-06-05 02:41:33
Zelda Gamekit (my project)



Example capxs:

Zelda-Style Inventory

Zelda Health

3-saveslot system

[url=https://www.dropbox.com/s/d4396pwak0oh7q6/ZeldaDialogueSystem.capx?dl=0]Zelda-like Dialogue[
B
51
S
24
G
30
Posts: 534
Reputation: 19,620

Post » Tue Jun 05, 2012 4:46 am

Thank you :)
B
5
Posts: 2
Reputation: 654

Post » Tue Jun 05, 2012 5:10 am

Your welcome! :D
Zelda Gamekit (my project)



Example capxs:

Zelda-Style Inventory

Zelda Health

3-saveslot system

[url=https://www.dropbox.com/s/d4396pwak0oh7q6/ZeldaDialogueSystem.capx?dl=0]Zelda-like Dialogue[
B
51
S
24
G
30
Posts: 534
Reputation: 19,620

Post » Tue Jun 05, 2012 8:59 pm

[QUOTE=LaDestitute] You should create a layer on the top called GUI (have the parallax set to 0,0) and set your health bar graphics layer to the GUI layer.

Edit: Also, I can create a tutorial for creating a dyanmic HP bar if you like. My project's HP/MP meters works in that fashion and has the "bar/meter" part overlaid on a border graphic.[/QUOTE]

I would like that tutorial!
B
9
S
3
G
4
Posts: 80
Reputation: 3,273

Post » Wed Jun 06, 2012 9:12 am

I'm halfway through making my tutorial, and I have a problem.
When the player takes damage, their HP meter goes completely empty and the text value showing current HP stays at max. It does that if "CurrentHP =/= Player.MaxHP", but nothing happens (and the meter stays full) if "CurrentHP < Player.MaxHP".
Zelda Gamekit (my project)



Example capxs:

Zelda-Style Inventory

Zelda Health

3-saveslot system

[url=https://www.dropbox.com/s/d4396pwak0oh7q6/ZeldaDialogueSystem.capx?dl=0]Zelda-like Dialogue[
B
51
S
24
G
30
Posts: 534
Reputation: 19,620

Post » Thu Jun 07, 2012 6:15 pm

Anybody?
Zelda Gamekit (my project)



Example capxs:

Zelda-Style Inventory

Zelda Health

3-saveslot system

[url=https://www.dropbox.com/s/d4396pwak0oh7q6/ZeldaDialogueSystem.capx?dl=0]Zelda-like Dialogue[
B
51
S
24
G
30
Posts: 534
Reputation: 19,620

Post » Sat Jun 09, 2012 9:50 pm

I would like help with fixing this bug so I can finish the tutorial and submit it.
Zelda Gamekit (my project)



Example capxs:

Zelda-Style Inventory

Zelda Health

3-saveslot system

[url=https://www.dropbox.com/s/d4396pwak0oh7q6/ZeldaDialogueSystem.capx?dl=0]Zelda-like Dialogue[
B
51
S
24
G
30
Posts: 534
Reputation: 19,620

Post » Mon Jun 11, 2012 5:01 pm

the best way to make any sort of bar that has a changing value is to use a ratio or a percent. You need a sprite thats the bar fill sprite and you shrink or stretch this sprite based on the ratio.

sprite.width = var_NormWidth*(CurHp/MaxHp)

var_NormWidth is the max width the bar should be when full. CurHp and MaxHp are obvious and dividing Cur by Max gives the ratio of Hp.
B
13
S
5
G
2
Posts: 306
Reputation: 3,262

Post » Sat May 21, 2016 11:46 am

[quote="LaDestitute"]You should create a layer on the top called GUI (have the parallax set to 0,0) and set your health bar graphics layer to the GUI layer.

I don't understand it
B
3
Posts: 5
Reputation: 181

Next

Return to How do I....?

Who is online

Users browsing this forum: matriax, R0J0hound, SnipG and 6 guests