如何以编程方式确定我的应用程序正在 iPhone、iPad 或 iPhone 4 上运行?

2024-08-11移动开发问题
7

本文介绍了如何以编程方式确定我的应用程序正在 iPhone、iPad 或 iPhone 4 上运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我刚刚使用 cocos2d 完成了我的 iPhone 游戏.但在将它放到 AppStore 之前,我想让它在 iPad(屏幕更大)和 iPhone 4(分辨率更大)上运行.
那么,如何以编程方式确定我的应用程序在 iPhone、iPad 或 iPhone 4 上运行,以便能够在我的游戏中使用正确的坐标/图像?

I just finish my iPhone game using cocos2d. But before I put it on the AppStore, I'd like to make it work on iPad (which have a bigger screen) and iPhone 4 (which have a bigger resolution).
So, how can I determine programmatically that my app is running on an iPhone, iPad or iPhone 4, to be able to use the correct coordinates / images in my game?

感谢您的帮助!

推荐答案

iPad 和 iPhone 之间 — 已经 已回答 许多 次.

iPhone 和 iPhone 4 之间 - 报告的尺寸仍然 320×480,因此您无需更改任何坐标.如果您需要高分辨率的 UI 图像,请为图像创建一个 @2x 替代方案.

Between iPhone and iPhone 4 — The size reported is still 320×480, so you don't need to change anything about the coordinates. Create an @2x alternative for the images if you need a high resolution UI image.

这篇关于如何以编程方式确定我的应用程序正在 iPhone、iPad 或 iPhone 4 上运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

硬件音量按钮更改应用程序音量
Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)...
2024-08-12 移动开发问题
10

Cocos2d - 如何检查不同层中对象之间的交集
Cocos2d - How to check for Intersection between objects in different layers(Cocos2d - 如何检查不同层中对象之间的交集)...
2024-08-12 移动开发问题
8

突出显示朗读文本(在 iPhone 的故事书类型应用程序中)
Highlight Read-Along Text (in a storybook type app for iPhone)(突出显示朗读文本(在 iPhone 的故事书类型应用程序中))...
2024-08-12 移动开发问题
9

Cocos2D + 仅禁用 Retina iPad 图形
Cocos2D + Disabling only Retina iPad Graphics(Cocos2D + 仅禁用 Retina iPad 图形)...
2024-08-12 移动开发问题
10

如何将 32 位 PNG 转换为 RGB565?
How to convert 32 bit PNG to RGB565?(如何将 32 位 PNG 转换为 RGB565?)...
2024-08-12 移动开发问题
21

正确的 cocos2d 场景重启?
Proper cocos2d scene restart?(正确的 cocos2d 场景重启?)...
2024-08-12 移动开发问题
7