Core Animation Architecture in Games?

Discussion in 'iOS Programming' started by chen8002004, Jun 14, 2011.

  1. chen8002004 macrumors newbie

    Joined:
    May 22, 2011
    #1
    I have developed an iphone graphics game using core animation. But I am not clear about how to make my application also possible to run on ipad. I know that the modification is just screen sizes and coordinates. How to modify my application so that different binaries can be generated for iphone, ipad or other apple devices from the same application? How to do it from architecture point of view?

    My current application architecture: A view controller handles user input (such as touches). A separate game data class is owned by view controller and holds coordinates and other game information. A view class holds layers and plays animations on these layers.
     
  2. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #2
  3. chen8002004 thread starter macrumors newbie

    Joined:
    May 22, 2011
    #3
    It is a good document, but not detailed enough. For example, how could my code check to see which device I am running on? Is there any Macro for this?
     
  4. Shawnpk, Jun 14, 2011
    Last edited: Jun 14, 2011

    Shawnpk macrumors 6502

    Joined:
    Jan 13, 2011
    Location:
    Los Angeles, CA
    #4
    There is a macro for this. Can't think of it right now though (of course). I'll see if I can find it.

    Here it is: UI_USER_INTERFACE_IDIOM()

    The you can use UIUserInterfaceIdiomPad or UIUserInterfaceIdiomPhone
     
  5. ChristianJapan macrumors 601

    ChristianJapan

    Joined:
    May 10, 2010
    Location:
    日本
    #5
  6. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #6
    There are. I didn't say it was complete, just a starting point for you to be able to see what is involved.

    All in all it's really more complicated than that as you need to do things differently on iPhone, IPhone w/retina display and iPad. Which orientations will you support, etc..., etc... (EDIT:ChristianJapan beat me to it).

    B
     

Share This Page