Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Entropy on April 25, 2013, 02:37:31 PM

Title: Progress Bar Scaling Wierd
Post by: Entropy on April 25, 2013, 02:37:31 PM
I have a bar to represent how much energy the character has that I scale from 0-100 based on the amount(the foreground that is). I understand you shouldn't really scale to 0 so I lock it at 0.000001 (practically 0) to give the effect. The problem is, the foreground doesnt seem to want to go below a scale of about 8. Reducing the scale below that results in the bar giving of the visual appearance of the scale being at about 8, unless I set it to 0.
This isn't an error in my code, as it happens whilst the game isn't even running.
Title: Re: Progress Bar Scaling Wierd
Post by: ArenMook on April 25, 2013, 03:26:35 PM
You can't shrink a sliced sprite below the sum of its borders. So if the sliced sprite's border is 4 on all sides, you are going to get exactly that -- 4+4=8 minimum.
Title: Re: Progress Bar Scaling Wierd
Post by: Entropy on April 26, 2013, 02:04:22 PM
So what is the work around? Can I change the borders?
Title: Re: Progress Bar Scaling Wierd
Post by: ArenMook on April 26, 2013, 08:57:32 PM
You can use a filled sprite instead.
Title: Re: Progress Bar Scaling Wierd
Post by: Entropy on April 29, 2013, 10:37:21 AM
Is there a way to stop the edge fading / feathering on the filled sprite?
Title: Re: Progress Bar Scaling Wierd
Post by: Nicki on April 29, 2013, 10:42:19 AM
As I recall, if you set a border on the source sprite, then filledSprite will cut that part off and avoid the feathering that way.
Title: Re: Progress Bar Scaling Wierd
Post by: Entropy on May 01, 2013, 12:17:02 PM
How do I remove the border? Im using the Sci-Fi atlas.
Title: Re: Progress Bar Scaling Wierd
Post by: ArenMook on May 02, 2013, 04:06:41 AM
Hit the Edit button beside the sprite, and remove it? :P
Title: Re: Progress Bar Scaling Wierd
Post by: Entropy on May 03, 2013, 02:10:11 PM
I don't want to come across as an idiot, but where do I find the sprite? Im just using the Sci-Fi Atlas, Dark on a progress bar.
Title: Re: Progress Bar Scaling Wierd
Post by: Nicki on May 03, 2013, 04:14:12 PM
Heh. It's a gameobject that's a child of the progressbar. There's a foreground and a background. Select it and look in the inspector. ;)

You can also find it by going directly to the atlas prefab in the project folder and then inspector (you can choose which sprite to focus on there).