Avtar Guleria
Avtar Guleria

Reputation: 2136

Basic questions for Cocos 2D First App

I am new to Cocos 2D, I have studied cocos 2D framework and after two days i am just confused and wanted to ask you some question.

I have to create an app with cocos2D framework for both iPhone and iPad target.

  1. When to use cocos Box 2d?
  2. Can we use nib files with Cocos2D? What is the standard way for creating UI?
  3. I have to create an app for both iPhone and iPad devices. How should i manage this? Whether we can provide diffrent nib files for the iphone and ipad target? Or i have to provide checks in my app for iphone and ipad.

Upvotes: 0

Views: 178

Answers (1)

Abhinav
Abhinav

Reputation: 191

According to me answer to your question is

1- Use Box2d only if you want to simulate some thing like real world.Gravity, mass, natural collision other wise simple 2d games can be made only using cocos2d.Box2d is for much real world simulation.

2-As far as I know there is no Nib files in cocos2d but we use CCLayer instead.All visible content of game is arranged on CCLayer or child of it.There is not any thing like Interface builder but we use coding for CCSprite,CCMenu,etc.

3-For creating app for i phone as well as i pad use universal build in device family on Info page of application.Use different resource for different device and do coding something like

if(UI_USER_INTERFACE_IDIOM()==UIUserInterfaceIdiomPad)
    {

CCSprite *back=[CCSprite spriteWithFile@"back-ipad.png"];
// rest of coding

    }
else
{

CCSprite *back=[CCSprite spriteWithFile@"back-.png"];
// rest of coding

    }

Upvotes: 0

Related Questions