Porting Over iPad game to iphone the easy way cocos2d

来源:互联网 发布:java毫秒转换成秒 编辑:程序博客网 时间:2024/05/16 11:14
//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);   }