cocos2d v3 支持多屏幕分辨率?

Multiple screen resolution support in cocos2d v3?(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 支持多屏幕分辨率?

基础教程推荐