From a2c71f8e89fb94dd82435162b6b9c5d7a896e231 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 9 Apr 2013 14:42:12 +0800 Subject: [PATCH] Exposing CCApplication to js. --- scripting/javascript/bindings/js/jsb_cocos2d.js | 13 +++++++++++++ tools/tojs/cocos2dx.ini | 13 +++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/scripting/javascript/bindings/js/jsb_cocos2d.js b/scripting/javascript/bindings/js/jsb_cocos2d.js index 48cee91290..8b828bbb5b 100644 --- a/scripting/javascript/bindings/js/jsb_cocos2d.js +++ b/scripting/javascript/bindings/js/jsb_cocos2d.js @@ -4,6 +4,19 @@ var cc = cc || {}; +cc.LANGUAGE_ENGLISH = 0; +cc.LANGUAGE_CHINESE = 1; +cc.LANGUAGE_FRENCH = 2; +cc.LANGUAGE_ITALIAN = 3; +cc.LANGUAGE_GERMAN = 4; +cc.LANGUAGE_SPANISH = 5; +cc.LANGUAGE_RUSSIAN = 6; +cc.LANGUAGE_KOREAN = 7; +cc.LANGUAGE_JAPANESE = 8; +cc.LANGUAGE_HUNGARIAN = 9; +cc.LANGUAGE_PORTUGUESE = 10; +cc.LANGUAGE_ARABIC = 11; + cc.DIRECTOR_PROJECTION_2D = 0; cc.DIRECTOR_PROJECTION_3D = 1; diff --git a/tools/tojs/cocos2dx.ini b/tools/tojs/cocos2dx.ini index ff71bb924b..a191075349 100644 --- a/tools/tojs/cocos2dx.ini +++ b/tools/tojs/cocos2dx.ini @@ -26,7 +26,7 @@ headers = %(cocosdir)s/cocos2dx/include/cocos2d.h %(cocosdir)s/CocosDenshion/inc # what classes to produce code for. You can use regular expressions here. When testing the regular # expression, it will be enclosed in "^$", like this: "^CCMenu*$". -classes = CCSprite.* CCScene CCNode.* CCDirector CCLayer.* CCMenu.* CCTouch CC.*Action.* CCMove.* CCRotate.* CCBlink.* CCTint.* CCSequence CCRepeat.* CCFade.* CCEase.* CCScale.* CCTransition.* CCSpawn CCAnimat.* CCFlip.* CCDelay.* CCSkew.* CCJump.* CCPlace.* CCShow.* CCProgress.* CCPointArray CCToggleVisibility.* CCHide CCParticle.* CCLabel.* CCAtlas.* CCTextureCache.* CCTexture2D CCCardinal.* CCCatmullRom.* CCParallaxNode CCTileMap.* CCTMX.* CCCallFunc CCRenderTexture CCGridAction CCGrid3DAction CCGridBase$ CCShaky3D CCWaves3D CCFlipX3D CCFlipY3D CCSpeed CCActionManager CCSet SimpleAudioEngine CCScheduler CCTimer CCOrbit.* CCFollow.* CCBezier.* CCCardinalSpline.* CCCamera.* CCDrawNode CC.*3D$ CCLiquid$ CCWaves$ CCShuffleTiles$ CCTurnOffTiles$ CCSplit.* CCTwirl$ CCFileUtils$ CCGLProgram CCShaderCache +classes = CCSprite.* CCScene CCNode.* CCDirector CCLayer.* CCMenu.* CCTouch CC.*Action.* CCMove.* CCRotate.* CCBlink.* CCTint.* CCSequence CCRepeat.* CCFade.* CCEase.* CCScale.* CCTransition.* CCSpawn CCAnimat.* CCFlip.* CCDelay.* CCSkew.* CCJump.* CCPlace.* CCShow.* CCProgress.* CCPointArray CCToggleVisibility.* CCHide CCParticle.* CCLabel.* CCAtlas.* CCTextureCache.* CCTexture2D CCCardinal.* CCCatmullRom.* CCParallaxNode CCTileMap.* CCTMX.* CCCallFunc CCRenderTexture CCGridAction CCGrid3DAction CCGridBase$ CCShaky3D CCWaves3D CCFlipX3D CCFlipY3D CCSpeed CCActionManager CCSet SimpleAudioEngine CCScheduler CCTimer CCOrbit.* CCFollow.* CCBezier.* CCCardinalSpline.* CCCamera.* CCDrawNode CC.*3D$ CCLiquid$ CCWaves$ CCShuffleTiles$ CCTurnOffTiles$ CCSplit.* CCTwirl$ CCFileUtils$ CCGLProgram CCShaderCache CCApplication # what should we skip? in the format ClassName::[function function] # ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also @@ -48,7 +48,6 @@ skip = CCNode::[.*Transform convertToWindowSpace ^setPosition$ getGrid setGLServ CCLayer.*::[didAccelerate (g|s)etBlendFunc], CCMenu.*::[.*Target getSubItems create initWithItems alignItemsInRows alignItemsInColumns], CCMenuItem.*::[create], - CCRGBAProtocol::[*], CCCopying::[*], CC.*Protocol::[*], CC.*Delegate::[*], @@ -97,7 +96,8 @@ skip = CCNode::[.*Transform convertToWindowSpace ^setPosition$ getGrid setGLServ CCTimer::[getSelector], *::[copyWith.* onEnter.* onExit.* ^description$ getObjectType], CCFileUtils::[(g|s)etSearchResolutionsOrder$ (g|s)etSearchPaths$ getClassTypeInfo], - SimpleAudioEngine::[getClassTypeInfo] + SimpleAudioEngine::[getClassTypeInfo], + CCApplication::[^application.* ^run$] rename_functions = CCDirector::[sharedDirector=getInstance], CCSpriteFrameCache::[sharedSpriteFrameCache=getInstance addSpriteFramesWithFile=addSpriteFrames spriteFrameByName=getSpriteFrame isFlipX=isFlippedX isFlipY=isFlippedY], @@ -121,7 +121,8 @@ rename_functions = CCDirector::[sharedDirector=getInstance], CCTMXTiledMap::[layerNamed=getLayer objectGroupNamed=getObjectGroup propertyNamed=getProperty], CCTexture2D::[defaultAlphaPixelFormat=getDefaultAlphaPixelFormat], CCShaderCache::[programForKey=getProgram sharedShaderCache=getInstance], - CCFileUtils::[sharedFileUtils=getInstance loadFilenameLookupDictionaryFromFile=loadFilenameLookup] + CCFileUtils::[sharedFileUtils=getInstance loadFilenameLookupDictionaryFromFile=loadFilenameLookup], + CCApplication::[sharedApplication=getInstance] rename_classes = CCParticleSystemQuad::CCParticleSystem, SimpleAudioEngine::AudioEngine @@ -130,14 +131,14 @@ rename_classes = CCParticleSystemQuad::CCParticleSystem, remove_prefix = CC # classes for which there will be no "parent" lookup -classes_have_no_parents = CCNode CCDirector SimpleAudioEngine CCFileUtils CCTMXMapInfo +classes_have_no_parents = CCNode CCDirector SimpleAudioEngine CCFileUtils CCTMXMapInfo CCApplication # base classes which will be skipped when their sub-classes found them. base_classes_to_skip = CCObject # classes that create no constructor # CCSet is special and we will use a hand-written constructor -abstract_classes = CCDirector CCSpriteFrameCache CCTransitionEaseScene CCSet SimpleAudioEngine CCFileUtils +abstract_classes = CCDirector CCSpriteFrameCache CCTransitionEaseScene CCSet SimpleAudioEngine CCFileUtils CCApplication # Determining whether to use script object(js object) to control the lifecycle of native(cpp) object or the other way around. Supported values are 'yes' or 'no'. script_control_cpp = no