Orx has very nice features that help us position graphics independently of resolution. Using a fixed Frustum width and height, I can be assured size and positioning remain correct with only one configuration file.
E.g. iPhone 4 has 2x the resolution of iPhone 3, but using a single Frustum for both I only need to define object positions once.
So, what are our options for designing for different aspect ratios?
It looks like one option is to just stay with one constant Frustum width and height for everything. In my testing of this, Orx scales the graphics to fit the shortest dimension and just leaves empty space (letterboxing) for the larger dimension. Is my observation correct in all cases?
Another option would be to attempt to dynamically place all graphic elements based on the aspect ratio on any particular screen. This would allow you to utilize the entire screen (no letterboxing).
Why would you need to do this? For example, with Android devices you are not guaranteed any particular aspect ratio (although, admittedly, most are not wildly different).
In this case, you allow the actual display resolution to define the Frustum dimensions. Then, for instance, you place three icons in the lower right hand corner by placing them relative to the lower right hand pixel in the display. Or, to distribute three objects horizontally, divide the screen width into three sections (w / 3 = x) and use x * 1, x * 2, and x * 3 to position each object.
The second option might improve the appearance on a few very unusual aspect ratios, but seems to be a lot more work!
Have I neglected any other options available when using Orx?
Comments
Having a fixed frustum will actually trigger up/downscaling and letter/pillarboxing when need be, as you mentioned.
However, for everything that need to be placed in screen space (mostly UI/HUD and fixed background, I'd say), you can define them with the ParentCamera attribute and set the UseParentSpace to either position, scale or both.
When you do that, your object will actually be a child of the camera (and follow it wherever it goes, no matter what its frustum is) and you can also position them relatively to the camera's actual frustum size.
You have then to give an explicit value to scale and/or position for it to work. 1 = full frustum size on that axis.
Also the axes are centered in front of the camera, that means that top left corner is at coord (-0.5, -0.5) and bottom right is as (0.5, 0.5). That also works for the Z axis with 0 being on the FrustumNear plane (and not displayed) and 1 being on the FrustumFar plane (and this one is displayed).
So if you have those objects:
Does this help?
Using different pivots helps with this kind of positioning, in the same way you'd use justification (left/right/center) for text positioning for example.