提供资源以支持Libgdx android中的多个屏幕 [英] Providing Resources for Supporting Multiple Screens in Libgdx android

查看:65
本文介绍了提供资源以支持Libgdx android中的多个屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在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中的多个屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆