Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started 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.
-
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.
-
So what is the work around? Can I change the borders?
-
You can use a filled sprite instead.
-
Is there a way to stop the edge fading / feathering on the filled sprite?
-
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.
-
How do I remove the border? Im using the Sci-Fi atlas.
-
Hit the Edit button beside the sprite, and remove it? :P
-
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.
-
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).