Author Topic: Progress bar with Minimum/Maximum range indicators  (Read 3522 times)

DuaneDog

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 27
    • View Profile
Progress bar with Minimum/Maximum range indicators
« on: February 17, 2014, 03:01:38 AM »
I have a need to have a progress bar that shows the current value for my speed... but I want to have a visual minimum and maximum indicator on the progress bar. Like a small little triangle at the .30 mark and another small little triangle at the .70 mark. The player will only get credit when between those two values. I am handling the game logic but was hoping someone could tell me if something like this is built into NGui or how to go about creating this functionality.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Progress bar with Minimum/Maximum range indicators
« Reply #1 on: February 17, 2014, 11:18:54 AM »
Just add those two triangles as two separate sprites and anchor them to 30% and 70% of the parent's width, respectively (use the Custom option of the layout system).

DuaneDog

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 27
    • View Profile
Re: Progress bar with Minimum/Maximum range indicators
« Reply #2 on: February 18, 2014, 02:15:47 AM »
Many thanks for the reply. I got this working quite easily by just using labels with "<" as the text and then just using a transform.localposition vector3 kind of deal to move then as necessary. One of the cool things is having them local is the math was much easier than I anticipated.