Author Topic: FixedSize UI; 640x640 UITexture fills width @640x1153 but not @640x960… WHY?  (Read 3078 times)

Joe @ ByDesign Games

  • Guest
Am building a portrait UI for iPhone5 (640x1156) and iPhone4 (640x960) and despite FixedSize being set in UIRoot (manual height 1136, min height 960, max height 1136), a 640x640 UITexture fills the screen width on the iPhone5 as expected, but not the iPhone4... despite having exactly the same screen width.

Why is this? I want the UITexture to be 640x640 on both and so should fill screen width on both, as they both have the same screen width.

How to get consistency here?

dlewis

  • Guest
Sounds like it's scaling by the height. So on iPhone 5 it's good but to fit into the height of an iPhone4 it must scale down which results in it getting smaller to fit but also more narrow

Joe @ ByDesign Games

  • Guest
Yeah, basically it comes down to FixedSize rescaling the UI such that it makes it impossible to rely on transform.localScale values being accurate.

Another way of saying: a scale value of 640 on a UI sized less than manualHeight (with FixedScale selected) isn't actually 640, even though it says it is 640.

Ended up writing a small class to selectively scale by the difference to compensate.

Not pretty, but it works.


Clearly this is an area of nGUI that could use some loving! (at least enough so the actual size of the element is shown, without doing some manual backend calculation)