Author Topic: Scaling a button bar  (Read 1260 times)

Failtruck

  • Guest
Scaling a button bar
« on: June 27, 2013, 04:08:44 AM »
hi all,

I am working on a game that has bar of buttons along that bottom of the screen.  I want that bar of buttons to scale to always fill 100% of the screen on the X and 15% of the screen on the Y.  However, when I am changing aspect ratio (even with the camera set at fixed size) they bar is remaining the same size but in the centre (see attached).  So I have a few questions now

a) how can I scale the buttons to always file the area I want
b) how to I get it to NOT scale the text (not sure I need this yet, it just popped into my head)

Any help would be gratefully received!

Cheers

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Scaling a button bar
« Reply #1 on: June 27, 2013, 01:14:29 PM »
a) Use UIStretch on the button backgrounds, as well as a separate UIAnchor to position each button, not a bottom UIAnchor for all of them.
b) By not scaling the button. Scale the background of the button instead.

See this thread: http://www.tasharen.com/forum/index.php?topic=4799.0