Is it possible to make a custom shape health bar?

nati22nati22 Member Posts: 11

I found numerous videos and discussions about health bars, but all seemed to use a simple rectangle shape. Would it be possible to make the health bar for example a circle that fills up?

Comments

  • KevinCrossKevinCross London, UKMember Posts: 1,894

    One way would be to create a 100 images and have the images change based on the percentage of the health.

    Another way would be to create an image with a transparent circle with a solid border and have a square behind the circle image that changes height based on the percentage of the health. You will need to make sure that your health circle image has a border that covers the square so that the player only sees what's inside the circle.

  • KevinCrossKevinCross London, UKMember Posts: 1,894
    edited June 2016

    If my instruction wasn't clear I've created two images to show what I mean.

    This shows the two actors together to create the health bar

    This shows the two actors split apart to show how they look

    You will need to make sure that your border fits in with the rest of your game design

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
  • KevinCrossKevinCross London, UKMember Posts: 1,894
    edited June 2016

    I've found a third way although I don't know what it will look like with images. I tried it with solid colour actors

    • Create a white circle and make an actor from it.
    • Create a second actor which is just a red box.
    • Put the red box above the white circle actor on your scene and on the red box actor change the Blending Mode to Multiply in the actors attributes.

    Keep in mind that any actors underneath the red actor will show part of the red actor on top of them. If you can place your health bar at the back of the scene and know nothing will ever cover it then this might be an easier option.

    This is how it looks in the scene

    And this is how it looks once the game is running

  • ArmellineArmelline Member, PRO Posts: 5,354

    If you're looking for rounded edges, there's a template for that on my site. If you're looking for circular, that's already well covered :D

  • SocksSocks London, UK.Member Posts: 12,822

    Another couple of possible solutions (attached)

    A circle fill based on maths, and a power meter (click in the white square and drag), might be something worth extracting from them ?

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    @Socks, the circular drag meter is very nice, pretty special effect too...

  • SocksSocks London, UK.Member Posts: 12,822

    @jamie_c said:
    @Socks, the circular drag meter is very nice, pretty special effect too...

    Cheers, it would be good for powering up a shot before releasing it, but you could also convert it daily easily to a health bar / meter.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    I had a fun time trying to figure this out a while back: http://forums.gamesalad.com/discussion/90653/analog-clock-timer-demo/p1

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • jay2dxjay2dx Member Posts: 611

    I keep meaning to get that template for a game idea I've had! I made a golf game but can't get the shot direction and power to work too well so just want to use yours :)

Sign In or Register to comment.