Posted By

espinallab on 05/07/11


Tagged


Versions (?)

Porting Over iPad game to iphone the easy way cocos2d.


 / Published in: Objective C
 

  1. //Add this code after "make the OpenGLView a child of the view controller" in the AppDelegate.m
  2.  
  3. //This will shrink the content of the ipad to fit on the iphone smoothly.
  4.  
  5. if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
  6. //0.9375/2 = 0.46875 * 1024 = 480
  7. glView.layer.transform=CATransform3DMakeScale(0.9375/2, 0.9375/2, 1);
  8. glView.layer.transform=CATransform3DTranslate(glView.layer.transform, -580, -480+37, 0);
  9. }
  10.  

Report this snippet  

You need to login to post a comment.