Cocos2d-x Analysis on game adaptation on mobile phones with different resolutions

Source: Internet
Author: User

After my research during this period, I found that the size of the mobile phone screen does not matter whether the game can be fully displayed, because the resolution is different. For example, cocos2d-x for our developers to provide the resolution is 480*320, we can easily make the game full screen display, but the problem is the big point of the phone resolution?

Here is the resolution of some mobile phones I found online:

We can see that 480*320 resolution mobile phones are not mainstream, and this is a problem. When we install a game with a resolution of 480*320 on a mobile phone with a resolution greater than 480*320, the game will become small and most black areas will appear. This is too boring.

How can this problem be solved?

My idea is how to do it easily. I have read it online and it is very troublesome. I can develop game engines. I found the intermediate resolution of the mobile phone, which can be set to 1024*768 based on this to adapt to most mobile phones. Use setscale () to scale the overall scale using the genie and map.

The results are very good. I tried several mobile phones with different resolutions: Xiaomi 2, Lenovo AR728, and IPAD2,


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.