问题描述
在 android 中,我可以为许多屏幕分辨率提供替代资源,例如 drawable-hdpi、drawable-ldpi 和 drawable-mdpi.libgdx 是否会意识到它正在使用特定的屏幕密度并为其使用适当的资源?
In android I can supply alternative resources for many screen resolution such as drawable-hdpi, drawable-ldpi, and drawable-mdpi. Will libgdx realize it is working with a certain screen density and use the appropriate resource for it?
推荐答案
Libgdx 不像 Android 那样直接支持多分辨率资源.但是,Libgdx 确实有一些支持.ResolutionFileResolver 类允许您将文件名解析为最佳分辨率.但是,您有责任设置可能的分辨率和目录名称.AssetManagerTest.
Libgdx doesn't directly support multi-resolution resources the way Android does. However, Libgdx does have some support. The ResolutionFileResolver class allows you to resolve file names to the best resolution. However, you are responsible for setting the possible resolutions and directory names. There is an example use in the AssetManagerTest.
这篇关于在 Libgdx android 中提供支持多屏的资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!