Hi Guys,
I knew until unless I try out my doubts, I won’t be satisfied.
So, i tried our with images designed my own template like Frahaan did, and during the designing of the template, I visualized that… ya there are a lot of assets sizes which share the same aspect ratio and can be scaled down to fit sizes without compromising the boundary cuts.
So, here’s what I found -
point 1. If we design our game assets with the highest resolution of 2560 x 1440, which on division gives 1.77
then it can be scaled down of all the resolutions which share the same aspect ratios.
Therefore, I noted down all possible android resolutions and found this -
( 854 x 480 ) * 3
( 960 x 540 ) * 2.66
( 1136 x 640 ) * 2.25
( 1280 x 720 ) * 2
( 1920 x 1080 ) * 1.33
all these counts to 2560 x 1440. That means we can have our entire design built with 2560 x 1440
and cover a hell lot of devices ( including iphones ).
Now, as devices with low memory and performance ( specifically the devices under 1136 x 640 ) needs assets of smaller sizes. Therefore, I would use 1136 x 640 as the design resolution and the asset size, then assets can be scaled down based on the calculation done on point 2.
Moving on, Ipad and Ipad Retina are pain in the butt ( i don’t know why the came up with such odd resolutions ).
So, for that we need to design asset 2048 x 1536 which is twice of 1024 x 768 and can be scaled down.
Now, the final part -
Some devices has strange width or height. ( mostly has aspect ratio of 1.6 )
Such as,
2560 x 1600
1920 x 1200
1280 x 800
960 x 640
To make our assets work on every device, we need to cover these resolutions also.
But, I will use same assets for -
HDR ( 2560 x 1440 )
HD ( 1136 x 640 )
IPAD ( 2048 x 1536 )
and to fit these assets to the screen we have to compromise a bit of our assets
( width/height will be clipped off depending on landscape/portrait )
point 2. The calculation assumes NO_BORDER with 100 px non-playable area (from each sides) of the design.
auto screenSize = glview->getVisibleSize();
Director::getInstance()->setContentScalingFactor( min( screenSize.width / designSize.width , screenSize.height / designSize.height));
and the designResolution sizes would be -
2560 x 1440
1136 x 640 and
2048 x 1536
based on calculations.
I see it covers almost all devices.
Your suggestions are always welcome.