I made a small game, I tested it on a mobile phone with a 1920 x 1080 display. Naturally, the question now is how it will work on other displays. First, I created a class that returns the proportionality number into which all drawing should be divided, if the displays are with a smaller screen than 1920 (with an aspect ratio like that of HD). But dividing every little thing by a number - everything looks very scary in terms of readability of the code. Therefore, I decided to simply duplicate the classes for each display and enter the necessary parameters there, so it is safer and clearer. Will the weight of the program increase significantly with such dubbing classes? If the program all chooses exactly one variant of classes for its display, the rest of the objects will not be created? And accordingly, it should not take them too much memory more than a few kilobytes? Adaptation for different displays so solved or in another way?

    1 answer 1

    An impressive amount of "displays" to suit your needs can be tested in an emulator, for example Genimotion . Duplicate classes under each display is definitely not a solution.