Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: makeshiftwings on May 15, 2012, 01:41:08 AM

Title: Scaling a sliced sprite's parent
Post by: makeshiftwings on May 15, 2012, 01:41:08 AM
When you scale a sliced sprite window, it maintains the corners at their normal size and scales the edges only in their necessary direction, which is awesome.  But if you have a sliced sprite window that is the child of a different object, and you scale the parent, it scales the sliced sprite as if it was a normal sprite and you get ugly borders.  Is there a way to avoid this?  Do I have to scale the sliced sprite and the other child objects each individually, or is there some trick to get it to work when I scale the parent?
Title: Re: Scaling a sliced sprite's parent
Post by: Nicki on May 15, 2012, 04:49:09 AM
Don't do that. :)

Never have a widget be a parent of another widget. Make an empty gameobject as a common parent instead.
Title: Re: Scaling a sliced sprite's parent
Post by: ArenMook on May 15, 2012, 01:31:06 PM
I don't think he meant parenting to another widget, Nicki -- just another object.

To answer the original question -- scaling a parent of the sliced sprite will always scale the widget the way you see it now. It won't maintain the border size. If it was the other way around, imagine how bad it would get if you tried to shrink away the window using sliced sprites.