Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: DuaneDog on February 17, 2014, 03:01:38 AM

Title: Progress bar with Minimum/Maximum range indicators
Post by: DuaneDog 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.
Title: Re: Progress bar with Minimum/Maximum range indicators
Post by: ArenMook 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).
Title: Re: Progress bar with Minimum/Maximum range indicators
Post by: DuaneDog 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.