The principle of screen adaptation

Source: Internet
Author: User

The basic game developers often encounter screen adaptation problems, because the Android phone screen is very different, the screen size of various mobile phones are different, while the screen different resolutions, so when the game to test the mobile phone, screen matching work is very important.

Now let's talk about the screen fit for those things.

Folders for different resolutions

First we know that Android Engineering directory Res has four folders, drawable-hdpi, drawable-mdpi, drawable-ldpi, drawable-xhdpi, mainly to support multi-resolution images. If you make the game transduction is 480x800 transduction, it should be placed in the drawable-hdpi directory, if 320x480 transduction, it should be placed in the MDPI directory. If it is 720x1280, it is usually placed in the xhdpi directory.

How the picture is handled by default

The Android system has a strict set of rules for loading images, which will determine the resolution of the screen in advance and then load the image in the corresponding folder according to the resolution. If it is not found, it will be looked up from drawable or other drawable-* folders. After the image is found, the system will compare the image size with the phone screen, the size of the same will be normal display, and the size of the inconsistency of the system will be based on a certain pattern of the image size scaling, and then displayed on the screen. At this point, because the picture size is scaled, so the display effect on the screen will be affected, so usually in the game testing phase, the tester should be prepared for different sizes with different resolutions of the device for multiple checks, If you want to have a large-scale mobile game compatibility test before you go online, try using a third-party hand-tour automation test platform such asTestbird .

Different proportions of screen common adaptation methods

Usually mature game manufacturers for different proportions and different resolutions of the screen, there will be a own solution. For small and medium-sized development teams or individual developers, often do not have the time to specifically adapt to different sizes of screens, such as the common Android device screen ratio of 16:9, and the same as the Meizu screen ratio of 15:9,ipad is 4:3, so the screen adaptation becomes extremely troublesome. Common picture scaling in such cases will cause the loss of the screen edge content, usually the best way is to zoom the picture to the maximum, the left part of the black edge area is not displayed, and the advantage is that it can not lose anything, but the disadvantage is that the black edge area will actually affect the user experience. As early as the ipad is not yet popular, in order to ensure that the game as much as possible compatible with the ipad, so a large number of the use of such an adaptation scheme.

Also worth mentioning is that if the production of hand Ranchettu, the master can be used as much as 720P, because the current mainstream model of the screen resolution is 720p,720p in the process of zooming the picture zoom to 1080P will not feel particularly blurred, reduced to 480P will not see the content. This is a very common screen adaptation solution, but since the 15 1080p will begin to popularize, so I think the situation will soon change.

The principle of screen adaptation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.