HTML and CSS Reference
In-Depth Information
// main entry
try {
director = cc.Director.getInstance ( ) ;
director.runWithScene ( new GameScene( ) ) ;
// Show the game in full screen mode.
cc.EGLView.getInstance( ).setDesignResolutionSize( 480, 318,
cc.RESOLUTION_POLICY.SHOW_ALL ) ;
} catch ( e ) {
log ( e ) ;
}
The require() function will load a JavaScript module and use a filename as a parameter. The jsb.js is the
module that needs to be loaded if you are using Cocos2d-x JSB to develop a game. A module only needs to be loaded
once in the runtime before it can be used anywhere else.
Load all JavaScript modules in the file cocos2d-jsb.js , and leave all of the JavaScript files unchanged.
Building for iOS
Switch to the project directory, and open the project. The code in Listing 24-27 shows how to do this.
Listing 24-27. Opening an iOS Project
cd ~/work/HalloweenDefence/Cocos2d-x-2.2.2/projects/HalloweenDefence/proj.ios
open TD.xcodeproj
Select the targets of this project in Xcode, switch to label “Build Phases,” and unfold the item “Copy bundle
Resources” (see Figure 24-23 ).
Figure 24-23. Copying bundle resources
 
Search WWH ::




Custom Search