Author Topic: Button Widget Size  (Read 4740 times)

vellocet

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
Button Widget Size
« on: May 03, 2012, 11:31:07 PM »
I'm pretty new to this but I'm having an issue with the Add Button widget tool.

When I use the widget tool to add the template "button" with a custom background sprite (that I've added to the atlas), it adds a button thats significantly smaller than the resolution of the sprite.  If I add a template "sprite" with the same sprite texture, it comes out the right size.

I can create a button from scratch and then swap the sprite and then change the collider size but I'm wondering if there's something I'm doing wrong that's causing the button to be a different size than the texture.

Thanks in advance!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Button Widget Size
« Reply #1 on: May 04, 2012, 08:03:01 AM »
You need to use NGUITools.AddChild to add it, and the scale of the button object you're adding should be (1, 1, 1) in the prefab, as that's what it will come out to be when you add it.