[Android game development 27] describes the hdpi, mdpi, and ldpi resource folders under game development and projects, and sets game HD versions.

Source: Internet
Author: User

Li huaming himiOriginal, reprinted must be explicitly noted:
Reprinted from[Heimi gamedev block]Link: http://www.himigame.com/android-game/389.html

Today, a developer asked me why I want to delete the hdpi, mdpi, and ldpi folders under the game development project. I will give you a detailed answer below:

First, if the kids shoes read [android game development 21] Android OS device lie resolution solution I wrote! In this section, we should all know that android ranges from 1.6 to higher. Google has added the automatic adaptation function to facilitate developers to transplant various resolution models;

The principle of automatic adaptation is very simple. If you create a project of 1.6 or higher, you will see three folders under the project: drawable-hdpi, drawable-mdpi, and drawable-ldpi, these three folders are respectively placed with high-resolution, medium-resolution, and low-resolution resource files. If your project runs on high-resolution, resources in the drawable-hdpi folder are indexed by default;

"Watermark" is placed in drawable-mdpi, the system will enlarge the image by default; otherwise, if you load an image at a low resolution, once you put the image into the high-definition drawable-DPI, the system will narrow down the image by default;

To sum up, if your application wants to adapt to high, medium, and low resolutions, you need to put three sets of images in the corresponding folder so that the system can load them intelligently; if you don't want the system to be intelligently scaled, there are two solutions:

1. Delete the drawable-hdpi, drawable-mdpi, and drawable-ldpi folders and create a drawable folder;

2. Put the resource file into assets, because the Resource System in assets will never generate an ID for it, so it will not be intelligently scaled;

------------------- The following describes how to make your game application HD

In fact, it is still in [android game development 21] Android OS device lie resolution solution! According to the introduction in, after Android 1.6, the screen width and height you get are actually inaccurate due to smart judgment, for details, refer to [android game development 21] Android OS device lie resolution solution! "; Here we need to add:

If you define <uses-SDK Android: minsdkversion = "4"/> In androidmainfest, it will be OK! You will find that your image is clear, but it is also caused by Android auto scaling. As mentioned above, the resolution obtained is generally abnormal (smaller than the correct one) once you add this sentence, your resolution will be normal, so it is obvious that the quality of the game is a high level.

 

Once you define <uses-SDK Android: minsdkversion = "4"/>, you cannot install your program on your 1.5sdk mobile phone;

OK. Keep busy. Please try again ~

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.