Hello Guest

Author Topic: how to auto fit button graphic size?  (Read 5611 times)

layola

  • Newbie
  • *
  • Posts: 5
    • View Profile
how to auto fit button graphic size?
« 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?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: how to auto fit button graphic size?
« Reply #1 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?

layola

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: how to auto fit button graphic size?
« Reply #2 on: September 18, 2013, 11:31:46 am »
TK2DROOT\tk2dUI_demo\ControlPrefabs\Basic\BasicButton.prefab
this,can't be auto fix fit.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: how to auto fit button graphic size?
« Reply #3 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?

layola

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: how to auto fit button graphic size?
« Reply #4 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..


unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: how to auto fit button graphic size?
« Reply #5 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.