Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: NuneShelping on August 28, 2013, 03:03:16 PM

Title: Modifying Sliced Sprite to Scale Borders when Center Empty
Post by: NuneShelping on August 28, 2013, 03:03:16 PM
I'm working on a drag-select box and am using a sliced-sprite to render the box. Doing so means that the minimum size of the box is equal to the sliced sprite border widths. I was thinking that it would be useful to extend SlicedSprite so that the borders scale when the center cannot be scaled any more.

For instance, if your box is tall but thin, to the point of no longer containing a center, the left and right edges shrink horizontally.

Would something like this be feasible, or is there something else I should be using instead?
Title: Re: Modifying Sliced Sprite to Scale Borders when Center Empty
Post by: ArenMook on August 28, 2013, 11:47:37 PM
Yes, but generally doing so makes it very obvious and quite ugly, which is the reason I didn't do it.