I want to make this health bar:
But no idea how to achieve these shapes in defold(I will also like to hear what you have to say of this health bar)
Thanks in advance(again rip you too many questions I ask)
I want to make this health bar:
But no idea how to achieve these shapes in defold(I will also like to hear what you have to say of this health bar)
Thanks in advance(again rip you too many questions I ask)
Do you have sprites for this stuff, or wanna hardcode it?
I can make sprites but rather hardcode it
With sprites, You can just create a healthbar like this in 5 lines of code( I did that yesterday). So, I would recommend having sprites for this. As I am not pretty sure about the hardcoding part.
Just say something like
if message_id == hash ("set_health") then
self.max_health = self.max_health or message.health
local scale = gui.get_scale("healthbar")
scale.x = message.health/self.max_health
gui.set_scale(self.healthbar, scale)
end
Ok I have this these are enough cuz player only have like 3 lifes kek
See it here (top left)
Or here(the healthbar above everyone’s head)
You should have asked some moments ago, I just closed my computer , else I could have shown some clear ones too,
why th the hud gui cant get the images from my healthbar.atlas wth
EDIT: Any texture in the atlas
Just post a sample of what you are trying to do.
You need to add healthbar.atlas to the textures on the RHS of your gui. Then it will show up too
Oh I see that now smh lol
gui.set_texture(node, "healthbar")
gui.play_flipbook(node, "live2")
EDIT: I have replaced set_texture(node to “Textures”/“Texture”)
And play_flipbook(node to “Box”/“box”)
What Am I getting wrong here?