Author Topic: Scaling a sliced sprite's parent  (Read 4566 times)

makeshiftwings

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 25
    • View Profile
Scaling a sliced sprite's parent
« 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?

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Scaling a sliced sprite's parent
« Reply #1 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.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Scaling a sliced sprite's parent
« Reply #2 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.