Author Topic: Change sprite borders at runtime  (Read 12980 times)

akutruff

  • Guest
Re: Change sprite borders at runtime
« Reply #15 on: December 17, 2012, 04:21:22 PM »
Hi Aren,

The thread you linked to is for a sliced tiled sprite, which really doesn't solve the problem.   The problem is that sliced sprites, when they are smaller than their border, will not get any smaller.  The borders are the issue, not the center.

When the sprite becomes small enough that no middle should be shown, the sprite should then start behaving like a filled sprite. 

Thanks,
Andy

akutruff

  • Guest
Re: Change sprite borders at runtime
« Reply #16 on: December 17, 2012, 05:28:57 PM »
Actually, its not just when they get too small.  It needs to get small when the foreground starts shrinking.

The point: The world needs to be able to use a sliced sprite for the foreground of a progress bar / slider and it behave like we would expect it to.  This way, we can make variable sized progress bars.

akutruff

  • Guest
Re: Change sprite borders at runtime
« Reply #17 on: December 17, 2012, 07:55:15 PM »
I went ahead and made a sliced filled sprite that only works in the x direction as an example.  It takes a percentFilled parameter and does the magic there-in.  It would be great if this was made complete and rolled into the mainline NGUI.