Author Topic: scale buttons for larger screens  (Read 3376 times)

reformy

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 28
    • View Profile
scale buttons for larger screens
« on: September 18, 2012, 09:12:45 AM »
hi all
I am working on a mobile app. I've built a row of 4 square buttons, total width 480px. It is anchored to the bottom of the screen. On my desire hd (480x800) it is right down there, and fits the screen width perfectly.
On a galaxy tab 7 (600x1024) it is at the bottom alright, but the total buttons take only 80% of the width (still 480px).

Is there an easy way to scale up the buttons so that will fit the screen exactly?
Should i find a way to get the real screen width at runtime and scale accordingly?
Thanks,
Yair

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: scale buttons for larger screens
« Reply #1 on: September 18, 2012, 09:40:30 AM »
You can use UIScale on the button background to achieve this.

reformy

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 28
    • View Profile
Re: scale buttons for larger screens
« Reply #2 on: September 18, 2012, 01:14:04 PM »
Thanks for the answer!

I can't find a script called "uiscale". is that part of the package?

Yair

PhilipC

  • Guest
Re: scale buttons for larger screens
« Reply #3 on: September 18, 2012, 01:19:19 PM »
I'm not 100% sure but i think he means UIStretch.

reformy

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 28
    • View Profile
Re: scale buttons for larger screens
« Reply #4 on: September 18, 2012, 02:23:19 PM »
Thanks PhilipC - that was exactly what I needed...