Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: vellocet 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!
-
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.