Multiple screen resolution support in cocos2d v3?(cocos2d v3 支持多屏幕分辨率?)
问题描述
我对 cocos2d v3 对多种屏幕分辨率的支持有点困惑.如果我使用 CCSetupScreenMode: CCScreenModeFlexible
,我提供的图像的默认分辨率应该是多少?
I am little confused with cocos2d v3's support for multiple screen resolutions. If I use CCSetupScreenMode: CCScreenModeFlexible
, what should be the default resolution of the image that I provide?
目前,我已为所有 iOS 设备分辨率以及后缀提供资源,并且在 iPhone3.5 英寸"和 iPad 上加载了正确的图像.但是,iPhone4 英寸"的-568h@2x"后缀不能正常工作.我使用了错误的后缀吗?
Currently, I have provided assets for all the iOS device resolutions along with suffixes and the correct images are loaded on iPhone "3.5inch" and iPad. However, the "-568h@2x" suffix for iPhone "4 inch" is not working fine. Am i using the wrong suffix?
我想避免使用宏来确定运行游戏的设备并相应地加载图像.
I would like to avoid the need to use macros to determine which device the game is running on and load the images accordingly.
感谢您的宝贵时间!
推荐答案
ScreenMode 仅定义屏幕是否随设备尺寸放大.
The ScreenMode only defines if the screen scales up with the device size or not.
固定屏幕
模式为你提供了一个有安全区域和不安全区域的舞台,但完整的舞台总是相同的大小.
The fixed screen
mode provides you with a stage that has a safe area and an unsafe area but the complete stage always has the same size.
在灵活屏幕模式
下,你的场景根节点会根据实际屏幕大小调整大小,所以你必须处理动态大小.
In the flexible screen mode
the root node of your scene will resize with the actual screen size, so you have to deal with dynamic sizing.
您可以在 我们的教程.
在 Cocos2D 中,后缀与 UIKit 使用的不同.后缀是:
In Cocos2D the suffixes are different from the ones UIKit uses. The suffixes are:
- -ipad
- -ipadhd
- -高清
- -iphone5hd
这篇关于cocos2d v3 支持多屏幕分辨率?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:cocos2d v3 支持多屏幕分辨率?


基础教程推荐
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01