Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>It looks like your approach is overly complicated. Making a universal application typically involves never hard-coding position values, but rather calculating these position values based on the bounds of the device.</p> <p>For example:</p> <pre><code>//Button in center for universal CGPoint buttonOffset = CGPointMake( ([[UIScreen mainScreen] bounds].size.width - button.frame.size.width) / 2, ([[UIScreen mainScreen] bounds].size.height - button.frame.size.height) / 2); button.frame = CGRectMake(buttonOffset.x, buttonOffset.y, button.frame.size.width, button.frame.size.height); </code></pre> <p>Use similar concepts to create buttons (or ships) with positions that are relative to the screen bounds. This will save you a lot of time and grief.</p> <p>One thing to note is that the "bounds" of the screen will not factor in the device orientation. If you want to support multiple orientations you will find it useful to create a utility method to handle that logic for you.</p> <p>Something like:</p> <pre><code>+ (CGSize) deviceSize { CGSize size; if(UIDeviceOrientationIsLandscape([[UIDevice currentDevice] orientation])){ size = CGSizeMake([[UIScreen mainScreen] bounds].size.height, [[UIScreen mainScreen] bounds].size.width); } else { size = CGSizeMake([[UIScreen mainScreen] bounds].size.width, [[UIScreen mainScreen] bounds].size.height); } return size; } </code></pre> <p>I know you want an easy solution so you don't have to change all your values but I would recommend biting the bullet and changing the values. It will help you a lot in the long-run. Not only for this application but the practice will help in any application you create in the future.</p> <p><strong>Is it recommended that you create two different apps for universal?</strong> No, it is not recommended. You can select "universal" when creating the xcode project and also change it in an existing project. You will not need to create two builds or binaries either. Apple will recognize it as universal and make it available in the store for all devices. However, you will need to create multiple versions of a splash screen to accommodate different screen sizes and pixel densities.</p> <p><strong>are Mac versions of apps the same distribution channel as the app store for iPhone and iPad?</strong> Sort of... you can deploy to the app store and you gain more freedom since you can package and distribute the OSX binary yourself -- but you will have to create a separate app since you will most likely be using CocoaTouch libraries which are not supported on the mac. You will want to preserve functionality that does not use CocoaTouch such as your Rendering and Game Logic. If you are deploying to OSX, the large screen sizes will be the least of your concern. Advantages: Wider Audience. Disadvantages: Requires a lot of planning when architecting your app/game so you can reuse as much code as possible and cater to all screens.</p> <p><strong>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?</strong> Well... <em>some</em> extra work With some additional image assets for home screen icons and a splash screen you will be good to go.</p>
 

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