my UI disappears when i set parallax to 0

0 favourites
  • 10 posts
From the Asset Store
Set of 10 Parallax Background to make pixel art game.
  • 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?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • Thank you :)

  • Your welcome! :D

  • 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.

    I would like that tutorial!

  • 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".

  • Anybody?

  • I would like help with fixing this bug so I can finish the tutorial and submit it.

  • 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.

  • 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

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