//Add this code after "make the OpenGLView a child of the view controller" in the AppDelegate.m
//This will shrink the content of the ipad to fit on the iphone smoothly.
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
//0.9375/2 = 0.46875 * 1024 = 480
glView.layer.transform=CATransform3DMakeScale(0.9375/2, 0.9375/2, 1);
glView.layer.transform=CATransform3DTranslate(glView.layer.transform, -580, -480+37, 0);
}
cocos2d iPad游戏移植到iphone最简单的方式(缩小OpenGLView)
最新推荐文章于 2025-12-04 10:16:29 发布
本文介绍了一种在将OpenGL视图嵌入到iPhone设备上时使其内容平滑缩放的方法。通过调整视图的层转换和缩放参数,可以确保原本为iPad设计的应用界面在iPhone屏幕上也能正确显示。
1380





