Home AMX General Discussion

Showing Level via series of button states

JeffJeff Junior MemberPosts: 374
I have several instances where I would like to show a level via several button states. For example, I have a battery indicator that has 5 bars in it, and I would like to have each bar light up at 20% battery life, instead of having a true level. Is there a way to accomplish this easily?

I know I can set the battery to a level, read the level in code, and send the button state I want back to the panel, but I was hoping for something that could happen within my panel entirely. If this isn't possible, thats fine, I'm just curious.



  • ericmedleyericmedley Senior Member - 4000+ posts Posts: 4,177
    The button state thing is a bit of a quandry. You really can tell a button to go to a particular state. It's still either on or off in code. If you send the 'on' to a button it will go through the different states (for animations)

    To do what you wish you'll need to make a multi-state bar graph and send your levels there. Put your different graphics on each state.
  • JeffJeff Junior Member Posts: 374
    Dude, I had no idea there was such a thing as a multi state bargraph . . . but there it is.

    Thanks a ton, that does exactly what I wanted.

Sign In or Register to comment.