Note that there are some explanatory texts on larger screens.

plurals
  1. POiOS convert coordinates from iPhone to iPad compatibility
    primarykey
    data
    text
    <p>When I first started programming for iOS (with Cocos2d) I used a bunch of hardcoded coordinates based on 320x480 screen size for the iPhone. I just realized that I need to include at least a basic version of iPad and the iPad mini. </p> <p>I have read these:</p> <p>cocos2d (but i'm not sure if this is the best way?) <a href="https://stackoverflow.com/questions/3741160/cocos2dconvert-iphone-app-to-universal-app">cocos2d:Convert iPhone App to Universal App</a></p> <p>converting coordinates: <a href="https://stackoverflow.com/questions/9872916/convert-coordinates-from-iphone-screen-size-to-ipad-screen-size">Convert coordinates from iPhone screen size to iPad screen size</a></p> <p>converting iphone to ipad: <a href="http://iphonedevelopment.blogspot.com/2010/04/converting-iphone-apps-to-universal.html" rel="nofollow noreferrer">http://iphonedevelopment.blogspot.com/2010/04/converting-iphone-apps-to-universal.html</a></p> <p>Apple's documentation on creating universal app: <a href="http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/AdvancedAppTricks/AdvancedAppTricks.html#//apple_ref/doc/uid/TP40007072-CH7-SW24" rel="nofollow noreferrer">http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/AdvancedAppTricks/AdvancedAppTricks.html#//apple_ref/doc/uid/TP40007072-CH7-SW24</a></p> <ol> <li>is there an easy way to convert the graphical display from iPhone to iPad without editing every part of my code where I used a hard coded value? (50 spots, all in 1 file)</li> <li><p>what's the best practice for future coding with iOS/Cocos2D coordinates? should I do </p> <p><code>#define SPACE_SHIP_X_IPAD 384</code></p> <p><code>#define SPACE_SHIP_X_IPHONE 160</code></p> <p><code>if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone){</code></p> <pre><code>`[ship.setPosition ccp:(SPACE_SHIP_X_IPHONE,0)];` </code></pre> <p><code>} else {</code></p> <pre><code>`[ship.setPosition ccp:(SPACE_SHIP_X_IPAD,0)];` </code></pre> <p><code>}</code></p> <p>(by the way, will someone who knows how to format this code with the "#" sign, plz teach me how to format the above code?)</p></li> <li><p>is it recommended that I create 2 different apps - one for iphone and one for iPad? or this universal approach of only 1 app, and then selecting the distribution type when I submit to Appstore?</p></li> <li>are Mac versions of apps the same distribution channel as the app store for iPhone and iPad? what are the advantages or disadvantages to distributing on Mac as well? (i'm guessing it's not good because graphics would have to accomodate something liek the massive iMac?)</li> <li>just to make sure - my app file (which doesn't use anything iphone specific like calling) will work on the iPod and iPad Mini without ANY extra work, right?</li> </ol> <p>Any help would be greatly appreciated. I will upvote all good attempts</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload