Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    drawSegmentBar function

    Functions
    3
    3
    506
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • joyrider3774
      joyrider3774 last edited by joyrider3774

      Hey,

      i created a drawSegmentBar function. You know those bars going from red to orange to green or vice versa.
      The function allows you to define the position, width and height of the bar and you supply it the nr of segments to draw and your min max and current value to base the segment bar on. The function will then draw the segments as chosen and if your value changes the segments drawn or not drawn changes as well. You can create vertical or horizontal bars and flipped (right to left / bottom to top) or none flipped bars (left to right / top to bottom). you can also specify at which segments color changes need to happen. I'm no expert at this but it works for my usage and maybe people can use it or would like to experiment with it .I know i had some problems initially with it

      Here are some use cases:

      • health bar
      • mana bar
      • speed meter (like MPH / KMH shown visually)
      • Red / orange / green start racing light.
      • displaying number of remaining lives or other things visually
      • ...

      Here's screenhot
      from within my game:
      49fcfccd-13be-4e0c-a20c-3c1367022659-image.png

      different usages
      55955f1c-6381-410e-822d-d30e945cfc81-image.png
      Here's the functions code

      Here's the share code
      1d350b34-519c-4e61-9cad-2d24893ee71b-image.png

      1 Reply Last reply Reply Quote 7
      • SteveZX81
        SteveZX81 F last edited by

        Very cool! I'll have that, thanks!

        1 Reply Last reply Reply Quote 1
        • Dinocoder
          Dinocoder last edited by

          That is very nice! Thanks @joyrider3774 for sharing!

          1 Reply Last reply Reply Quote 1
          • First post
            Last post