android - Support multiple aspect ratio in Unity -
android - Support multiple aspect ratio in Unity -
i've been trying create unity 2d game supports each , every aspect ratios of devices both android , tablets. there way that's been provided or recommended unity?
in case, work create of scale
so, back upwards no matter screen are
//find screen resolution @ splash or loading screen float scalex = datafactory.screen_width / (float)datafactory.our_fixed_game_screen; float scaley = datafactory.screen_height / (float)datafactory.our_fixed_game_screen; if (scalex >= scaley) datafactory.scale = scalex; else datafactory.scale = scaley; //set size in game @ start private int gamewidth = (int) (1400 * datafactory.scale); private int gameheight = (int) (800 * datafactory.scale); private int startgamex = (int) (300 * datafactory.scale); private int startgamey = (int) (280 * datafactory.scale); private int objectx = (int) (410 * datafactory.scale) + datafactory.begin_x; private int objecty = (int) (979 * datafactory.scale) + datafactory.begin_y; private int objectgapx = (int) (400 * datafactory.scale); private int objectgapy = (int) (180 * datafactory.scale); private int objectwidth = (int) (560 * datafactory.scale); private int objectheight = (int) (400 * datafactory.scale); private int xring = (int) (1005 * datafactory.scale) + datafactory.begin_x; private int yring = (int) (1020 * datafactory.scale) + datafactory.begin_y; private int radiusoutside = (int) (740 * datafactory.scale); private int radiusinside = (int) (480 * datafactory.scale); private int radiusobject = (int) (600 * datafactory.scale); private int yobjectring = (int) (920 * datafactory.scale) + datafactory.begin_y;
* fixed valued valued create base of operations on single screen *
this sample of 3d game made, however, still utilize same concept @ gui part
this sample of 2d game used concept
android ios unity3d 2d aspect-ratio
Comments
Post a Comment