Automatic Screen Scaling
To handle a wide variety of resolutions, Gideros provides a functionaly called Automatic Screen Scaling.
Before starting your project, you determine your logical resolution and position all your sprites
according to this. For example, if you determine your logical resolution as 320x480, your
upper left corner will be (0, 0), your lower right corner will be (319, 479) and the center coordinate
of your screen will be (160, 240). Then according to your scale mode, Gideros automaticly scales your
screen according to the real resolution of your hardware.
There are 8 types of scaling modes:
- No scale: No scaling simply tells your application not to scale at all. In this mode, there’s no
scaling at all, and your stage sits on the upper left corner of the device screen.
- No scale, center: This mode is similar to “no scale”, except one minor difference: Stage is centered
on the device screen.
- Pixel perfect: This mode is similar to “No scale, center”, with a minor difference: Scale value is rounded
to values like 1/3, ½, 1, 2 or 3. This mode can be used in games which benefit from pixel art games - it guarantees
a crisp look and feel for screen sprites.
- Letterbox: Preserving the aspect ratio, it scales the stage so it fits the content on the device screen.
There’s a possibility that blank areas may occur on the device. Mostly, developer keeps the background a bit “bigger”
in order to eliminate these blank areas and fill it with background.
- Crop: This mode again does preserve the aspect ratio, and ensures that no blank areas are left on the screen.
Hence, some part of the background may be outside the visible area.
- Stretch: The whole stage sits on the screen. Since x/y is not preserved, there’s a possibility that
aspect ratio might change.
- Fit width: This mode fits the width of the stage, preserving the aspect ratio. It’s possible that
there might be blank areas at the top and bottom of the screen, or these areas may be outside the visible area. If
you have more than one screen in your application, and screen transition is from left to right (or vice versa),
then this mode is a perfect fit for you.
- Fit height: Similar to fit width, this time guaranteeing to fit the height. Very suitable for shoot'em-up type games.