Author Topic: Progress Bar Scaling Wierd  (Read 3502 times)

Entropy

  • Guest
Progress Bar Scaling Wierd
« 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.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Progress Bar Scaling Wierd
« Reply #1 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.

Entropy

  • Guest
Re: Progress Bar Scaling Wierd
« Reply #2 on: April 26, 2013, 02:04:22 PM »
So what is the work around? Can I change the borders?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Progress Bar Scaling Wierd
« Reply #3 on: April 26, 2013, 08:57:32 PM »
You can use a filled sprite instead.

Entropy

  • Guest
Re: Progress Bar Scaling Wierd
« Reply #4 on: April 29, 2013, 10:37:21 AM »
Is there a way to stop the edge fading / feathering on the filled sprite?

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Progress Bar Scaling Wierd
« Reply #5 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.

Entropy

  • Guest
Re: Progress Bar Scaling Wierd
« Reply #6 on: May 01, 2013, 12:17:02 PM »
How do I remove the border? Im using the Sci-Fi atlas.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Progress Bar Scaling Wierd
« Reply #7 on: May 02, 2013, 04:06:41 AM »
Hit the Edit button beside the sprite, and remove it? :P

Entropy

  • Guest
Re: Progress Bar Scaling Wierd
« Reply #8 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.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Progress Bar Scaling Wierd
« Reply #9 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).