Author Topic: Teach me the magic of scaling  (Read 1839 times)

Zniper69

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Teach me the magic of scaling
« on: May 13, 2013, 06:36:34 AM »
Hi people

I should perhaps start by mentioning that I've been searching for an answer for this issue, but I've not been able to find something that satisfies my needs.

The problem is that I have made an NGUI interface consisting of several panels, sprites, buttons, labels and progress bars. These are all fine and dandy, but unfortunately I cannot get them to scale correctly.

The goal is to ensure that all scaling is relative, meaning that if a button takes up 5% of the entire screen area with a resolution of 480x320 then it should also take up 5% of the screen space with a resolution of 2048x1536.

So far I've come to the understanding that it has something to do with settings in my UIRoot script on my UI Root (2D) gameObject. I have however not been able to find a good description of how I should change these settings in order to get what I want. Currently when resolution goes up, my GUI seem to either get smaller (or stay unchanged in terms of pixel-height/width). Whatever it is the result is that the interface will take up a smaller percent of the screen area as resolution gets higher. This especially becomes apparent when building my game to the iPad where my interface will be less than half the size that I want it to be. Anchors does however seem to work as intended..

I hope someone will be able to give me some guidelines here as the documentation is pretty vague on the topic.

Zniper69

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: Teach me the magic of scaling
« Reply #1 on: May 13, 2013, 07:22:42 AM »
I got what I wanted by changing the UIRoot "scaling size" setting to "Fixed size on mobiles".. So yeah..