Sorry for another-one-resolution-thread, but I'm still confused after reading previous ones.
I'm migrating from cocos2d-iPhone where I used 3 sets of sprite atlases:
- 1x: old iPhones 480x320
- 2x: iPhones w/ retina 960x640, iPhone 5 1136x640, old iPads 1024x768
- 4x: iPads w/ retina 2048x1536
Cocos2d has "points": one point equals 1 pixel on an old non-retina screen and 2 points on a new retina screen. So, iPhone/iPod touch screen size is always 480x320 points (568x320 for iPhone 5) and iPad screen size is 1024x768 point, regardless of DPI. All assets for iOS games were made 4x for iPad retina (with common divisor 8 to have accurate scaling) to and then scaled down with TexturePacker to 1x and 2x sprite atlases.
But for cross-platform development I have to deal with
all these resolutions plus some less popular (and sometimes unpredictable for Android).
I'm using tk2dCamera that scales content according to the resolution and Multiplatform Toolkit that positions and scales content by looking at the aspect ratio or platform. I'm not stretching sprites in games, but show larger pieces of the game world (when it's scrollable) or make some sort of letterbox (additional parts of background, more spacious GUI, etc.).
And I can't understand how to do the following things right.
Atlases for different DPIs2d Toolkit has
platform specific sprite collections and as far as I understand it is the same idea as I described above for cocos2d. But another method with mipmaps and changing quality settings is described in
this thread.
I'd like to use the latter method for smaller game file size. But will resizing textures on the fly significally increase loading time of every scene? Is Unity capable of quality downscaling of 2d art? (not pixel art)
Scaling down on the flySince I can't include sprites for every possible resolution, most of the time they will be scaled down (e.g: 4x sprites made for 2048x1536 will be scaled to 1600x1200 or 1920x1080). If I'm getting it right, all I need is a right setting for each resolution in tk2dCamera.
Relative positioningIt's simple for GUI with Multiplatform Toolkit, but I can't understand how to move dynamic objects in different DPIs and ratios.
Is tk2dCamera always counting 1 pixel for 1 Unity point and do I need to calculate positions and movement relating to DPI (multiply them by 1x-2x-4x)? Is scaled down content (by tk2dCamera, like from 2048x1536 to 1600x1200) not affecting pixel-to-points, but only physical size on the screen?upd: the answer from
this thread is "no, 1x, 2x, 4x sprites will all be physically exactly the same size, so distances will still be the same".
As far as I understand, I should work with points in 1x size and then despite 2x or 4x or other custom multiplier, my sprites always will use 1x point system. So I need to set up GUI and game world visibility for the lowest resolutions for all aspect ratios and then tk2dCamera will help me to scale it up using bigger sprites.