2D Toolkit Forum

2D Toolkit => Support => Topic started by: layola on September 18, 2013, 08:27:40 am

Title: how to auto fit button graphic size?
Post by: layola on September 18, 2013, 08:27:40 am
how to auto fit button graphic size?
example:
I change  the button's graphic  form a basebutton to a little bit circle icon
ori size is 100x30  and after icon size is 60X60
I don't want to use transform tool to resize to fit to 60x60,
I want to ask tk2d can auto fixed that size?
Title: Re: how to auto fit button graphic size?
Post by: unikronsoftware on September 18, 2013, 11:23:44 am
I don't think I follow - which button prefab are you using? The layout one or non-layout?
Title: Re: how to auto fit button graphic size?
Post by: layola on September 18, 2013, 11:31:46 am
TK2DROOT\tk2dUI_demo\ControlPrefabs\Basic\BasicButton.prefab
this,can't be auto fix fit.
Title: Re: how to auto fit button graphic size?
Post by: unikronsoftware on September 18, 2013, 11:35:42 am
I don't think I understand what you're trying to do here. Can you post some pics?
Title: Re: how to auto fit button graphic size?
Post by: layola on September 18, 2013, 12:24:59 pm
this forum seem have no upload files function
that button have no layout script and the I just change another sprite id .
and the size is not change..

Title: Re: how to auto fit button graphic size?
Post by: unikronsoftware on September 18, 2013, 12:59:16 pm
Use the one from ControlPrefabs\Layout\BasicButton if you want layout.
And no, the size will not change when you change the sprite - it is so you can create sprites that are bigger than buttons themselves. You can resize the button after that if you want.