ccb 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +20 -0
- data/README.md +31 -0
- data/bin/ccb +4 -0
- data/lib/ccb/builder/project_builder.rb +14 -0
- data/lib/ccb/builder/scene_builder.rb +9 -0
- data/lib/ccb/builder/templates/project/GameConfig.js.tt +21 -0
- data/lib/ccb/builder/templates/project/_cocos-project.json +4 -0
- data/lib/ccb/builder/templates/project/folder/CMakeLists.txt +295 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/Base64Images.js +32 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/CCBoot.js +2271 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/CCDebugger.js +336 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/actions/CCAction.js +694 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/actions/CCActionCamera.js +293 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/actions/CCActionCatmullRom.js +605 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/actions/CCActionEase.js +3681 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/actions/CCActionInstant.js +757 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/actions/CCActionInterval.js +3554 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/actions/CCActionTween.js +166 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/actions3d/CCActionGrid.js +372 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/actions3d/CCActionGrid3D.js +1257 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/actions3d/CCActionPageTurn3D.js +113 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/actions3d/CCActionTiledGrid.js +1289 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/audio/CCAudio.js +1024 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/clipping-nodes/CCClippingNode.js +224 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/clipping-nodes/CCClippingNodeCanvasRenderCmd.js +227 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/clipping-nodes/CCClippingNodeWebGLRenderCmd.js +226 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/compression/ZipUtils.js +82 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/compression/base64.js +95 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/compression/gzip.js +731 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/compression/zlib.min.js +55 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/CCActionManager.js +378 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/CCCamera.js +290 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/CCConfiguration.js +294 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/CCDirector.js +1019 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/CCDirectorWebGL.js +329 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/CCDrawingPrimitivesCanvas.js +438 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/CCDrawingPrimitivesWebGL.js +464 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/CCScheduler.js +744 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/base-nodes/BaseNodesPropertyDefine.js +127 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/base-nodes/CCAtlasNode.js +294 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/base-nodes/CCAtlasNodeCanvasRenderCmd.js +138 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/base-nodes/CCAtlasNodeWebGLRenderCmd.js +145 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/base-nodes/CCNode.js +2386 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/base-nodes/CCNodeCanvasRenderCmd.js +504 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/base-nodes/CCNodeWebGLRenderCmd.js +254 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/cocoa/CCAffineTransform.js +259 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/cocoa/CCGeometry.js +327 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/event-manager/CCEvent.js +449 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/event-manager/CCEventExtension.js +126 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/event-manager/CCEventListener.js +519 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/event-manager/CCEventManager.js +1025 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/event-manager/CCTouch.js +175 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/labelttf/CCLabelTTF.js +829 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/labelttf/CCLabelTTFCanvasRenderCmd.js +420 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/labelttf/CCLabelTTFWebGLRenderCmd.js +101 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/labelttf/LabelTTFPropertyDefine.js +88 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/layers/CCLayer.js +642 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/layers/CCLayerCanvasRenderCmd.js +434 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/layers/CCLayerWebGLRenderCmd.js +248 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/platform/CCClass.js +333 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/platform/CCCommon.js +303 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/platform/CCConfig.js +303 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/platform/CCEGLView.js +1245 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/platform/CCInputExtension.js +135 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/platform/CCInputManager.js +616 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/platform/CCLoaders.js +142 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/platform/CCMacro.js +830 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/platform/CCSAXParser.js +160 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/platform/CCScreen.js +155 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/platform/CCTypes.js +374 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/platform/CCTypesPropertyDefine.js +165 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/platform/CCTypesWebGL.js +689 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/platform/CCVisibleRect.js +100 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/platform/miniFramework.js +264 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/renderer/RendererCanvas.js +274 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/renderer/RendererWebGL.js +137 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/scenes/CCLoaderScene.js +149 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/scenes/CCScene.js +62 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/sprites/CCAnimation.js +477 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/sprites/CCAnimationCache.js +213 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/sprites/CCBakeSprite.js +71 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/sprites/CCSprite.js +1014 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/sprites/CCSpriteBatchNode.js +676 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/sprites/CCSpriteBatchNodeCanvasRenderCmd.js +101 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/sprites/CCSpriteBatchNodeWebGLRenderCmd.js +243 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/sprites/CCSpriteCanvasRenderCmd.js +518 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/sprites/CCSpriteFrame.js +420 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/sprites/CCSpriteFrameCache.js +341 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/sprites/CCSpriteWebGLRenderCmd.js +493 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/sprites/SpritesPropertyDefine.js +67 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/support/CCPointExtension.js +515 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/support/CCVertex.js +170 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/support/TransformUtils.js +62 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/textures/CCTexture2D.js +455 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/textures/CCTextureAtlas.js +653 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/textures/CCTextureCache.js +371 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/textures/TexturesPropertyDefine.js +221 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/textures/TexturesWebGL.js +899 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/core/utils/BinaryLoader.js +151 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/effects/CCGrabber.js +110 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/effects/CCGrid.js +737 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/kazmath/aabb.js +68 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/kazmath/gl/mat4stack.js +59 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/kazmath/gl/matrix.js +169 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/kazmath/mat3.js +329 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/kazmath/mat4.js +810 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/kazmath/plane.js +184 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/kazmath/quaternion.js +497 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/kazmath/ray2.js +163 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/kazmath/utility.js +76 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/kazmath/vec2.js +107 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/kazmath/vec3.js +205 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/kazmath/vec4.js +158 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/labels/CCLabelAtlas.js +239 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/labels/CCLabelAtlasCanvasRenderCmd.js +95 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/labels/CCLabelAtlasWebGLRenderCmd.js +132 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/labels/CCLabelBMFont.js +958 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/labels/CCLabelBMFontCanvasRenderCmd.js +142 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/labels/CCLabelBMFontWebGLRenderCmd.js +87 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/menus/CCMenu.js +600 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/menus/CCMenuItem.js +1422 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/motion-streak/CCMotionStreak.js +517 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/motion-streak/CCMotionStreakWebGLRenderCmd.js +66 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/node-grid/CCNodeGrid.js +129 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/node-grid/CCNodeGridWebGLRenderCmd.js +98 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/parallax/CCParallaxNode.js +252 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/parallax/CCParallaxNodeRenderCmd.js +69 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/particle/CCPNGReader.js +330 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/particle/CCParticleBatchNode.js +527 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/particle/CCParticleBatchNodeCanvasRenderCmd.js +38 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/particle/CCParticleBatchNodeWebGLRenderCmd.js +74 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/particle/CCParticleExamples.js +1006 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/particle/CCParticleSystem.js +2294 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/particle/CCParticleSystemCanvasRenderCmd.js +217 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/particle/CCParticleSystemWebGLRenderCmd.js +402 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/particle/CCTIFFReader.js +692 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/physics/CCPhysicsDebugNode.js +212 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/physics/CCPhysicsDebugNodeCanvasRenderCmd.js +52 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/physics/CCPhysicsDebugNodeWebGLRenderCmd.js +53 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/physics/CCPhysicsSprite.js +447 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/physics/CCPhysicsSpriteCanvasRenderCmd.js +93 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/physics/CCPhysicsSpriteWebGLRenderCmd.js +87 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/progress-timer/CCActionProgressTimer.js +227 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/progress-timer/CCProgressTimer.js +345 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/progress-timer/CCProgressTimerCanvasRenderCmd.js +270 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/progress-timer/CCProgressTimerWebGLRenderCmd.js +486 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/render-texture/CCRenderTexture.js +395 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/render-texture/CCRenderTextureCanvasRenderCmd.js +105 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/render-texture/CCRenderTextureWebGLRenderCmd.js +367 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/shaders/CCGLProgram.js +767 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/shaders/CCGLStateCache.js +340 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/shaders/CCShaderCache.js +301 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/shaders/CCShaders.js +280 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/shape-nodes/CCDrawNode.js +940 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/shape-nodes/CCDrawNodeCanvasRenderCmd.js +129 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/shape-nodes/CCDrawNodeWebGLRenderCmd.js +41 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/text-input/CCIMEDispatcher.js +526 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/text-input/CCTextFieldTTF.js +472 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/tilemap/CCTGAlib.js +437 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/tilemap/CCTMXLayer.js +914 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/tilemap/CCTMXLayerCanvasRenderCmd.js +232 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/tilemap/CCTMXLayerWebGLRenderCmd.js +67 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/tilemap/CCTMXObjectGroup.js +146 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/tilemap/CCTMXTiledMap.js +479 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/tilemap/CCTMXXMLParser.js +950 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/transitions/CCTransition.js +1971 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/transitions/CCTransitionPageTurn.js +152 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/cocos2d/transitions/CCTransitionProgress.js +458 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccb-reader/CCBAnimationManager.js +770 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccb-reader/CCBKeyframe.js +60 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccb-reader/CCBReader.js +1129 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccb-reader/CCBReaderUtil.js +61 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccb-reader/CCBRelativePositioning.js +90 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccb-reader/CCBSequence.js +114 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccb-reader/CCBValue.js +81 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccb-reader/CCControlLoader.js +318 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccb-reader/CCNodeLoader.js +905 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccb-reader/CCNodeLoaderLibrary.js +101 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccb-reader/CCSpriteLoader.js +544 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccpool/CCPool.js +146 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/base-classes/CCProtectedNode.js +305 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/base-classes/CCProtectedNodeCanvasRenderCmd.js +246 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/base-classes/CCProtectedNodeWebGLRenderCmd.js +159 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/base-classes/UIScale9Sprite.js +1105 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/base-classes/UIScale9SpriteCanvasRenderCmd.js +142 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/base-classes/UIScale9SpriteWebGLRenderCmd.js +129 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/base-classes/UIWidget.js +2059 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/base-classes/UIWidgetRenderCmd.js +100 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/layouts/UIHBox.js +80 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/layouts/UILayout.js +1558 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/layouts/UILayoutCanvasRenderCmd.js +179 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/layouts/UILayoutComponent.js +585 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/layouts/UILayoutManager.js +457 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/layouts/UILayoutParameter.js +576 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/layouts/UILayoutWebGLRenderCmd.js +240 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/layouts/UIRelativeBox.js +79 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/layouts/UIVBox.js +79 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/system/CocosGUI.js +62 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/system/UIHelper.js +164 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/uiwidgets/UIButton.js +987 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/uiwidgets/UICheckBox.js +737 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/uiwidgets/UIImageView.js +337 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/uiwidgets/UILoadingBar.js +432 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/uiwidgets/UIRichText.js +579 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/uiwidgets/UISlider.js +762 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/uiwidgets/UIText.js +512 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/uiwidgets/UITextAtlas.js +229 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/uiwidgets/UITextBMFont.js +216 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/uiwidgets/UITextField.js +915 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/uiwidgets/scroll-widget/UIListView.js +602 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/uiwidgets/scroll-widget/UIPageView.js +657 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/ccui/uiwidgets/scroll-widget/UIScrollView.js +1884 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/CocoStudio.js +68 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/action/CCActionFrame.js +528 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/action/CCActionManager.js +112 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/action/CCActionNode.js +417 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/action/CCActionObject.js +263 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/CCArmature.js +579 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/CCArmatureCanvasRenderCmd.js +190 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/CCArmatureWebGLRenderCmd.js +167 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/CCBone.js +711 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/animation/CCArmatureAnimation.js +669 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/animation/CCProcessBase.js +365 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/animation/CCTween.js +448 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/datas/CCDatas.js +807 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/display/CCDecorativeDisplay.js +118 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/display/CCDisplayFactory.js +220 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/display/CCDisplayManager.js +465 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/display/CCSkin.js +215 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/display/CCSkinCanvasRenderCmd.js +58 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/display/CCSkinWebGLRenderCmd.js +146 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/physics/CCColliderDetector.js +397 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/utils/CCArmatureDataManager.js +325 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/utils/CCArmatureDefine.js +45 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/utils/CCDataReaderHelper.js +1223 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/utils/CCSpriteFrameCacheHelper.js +68 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/utils/CCTransformHelp.js +183 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/utils/CCTweenFunction.js +501 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/armature/utils/CCUtilMath.js +69 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/components/CCComAttribute.js +210 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/components/CCComAudio.js +285 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/components/CCComController.js +76 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/components/CCComRender.js +91 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/components/CCComponent.js +136 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/components/CCComponentContainer.js +159 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/loader/load.js +221 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/loader/parsers/action-1.x.js +238 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/loader/parsers/action-2.x.js +266 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/loader/parsers/compatible.js +251 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/loader/parsers/scene-1.x.js +262 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/loader/parsers/timelineParser-1.x.js +292 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/loader/parsers/timelineParser-2.x.js +1288 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/loader/parsers/uiParser-1.x.js +680 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/timeline/ActionTimeline.js +448 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/timeline/Frame.js +1268 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/timeline/Timeline.js +321 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/trigger/ObjectFactory.js +99 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/trigger/TriggerBase.js +49 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/trigger/TriggerMng.js +301 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/cocostudio/trigger/TriggerObj.js +263 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/editbox/CCEditBox.js +716 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/editbox/CCdomNode.js +657 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/control-extension/CCControl.js +381 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/control-extension/CCControlButton.js +688 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/control-extension/CCControlColourPicker.js +187 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/control-extension/CCControlHuePicker.js +218 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/control-extension/CCControlPotentiometer.js +300 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/control-extension/CCControlSaturationBrightnessPicker.js +257 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/control-extension/CCControlSlider.js +308 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/control-extension/CCControlStepper.js +390 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/control-extension/CCControlSwitch.js +425 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/control-extension/CCControlUtils.js +177 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/control-extension/CCInvocation.js +65 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/control-extension/CCMenuPassive.js +415 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/control-extension/CCScale9Sprite.js +1099 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/control-extension/CCScale9SpriteCanvasRenderCmd.js +142 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/control-extension/CCScale9SpriteWebGLRenderCmd.js +129 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/scrollview/CCScrollView.js +827 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/scrollview/CCScrollViewCanvasRenderCmd.js +79 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/scrollview/CCScrollViewWebGLRenderCmd.js +108 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/scrollview/CCSorting.js +239 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/gui/scrollview/CCTableView.js +718 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/spine/CCSkeleton.js +357 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/spine/CCSkeletonAnimation.js +340 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/spine/CCSkeletonCanvasRenderCmd.js +165 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/spine/CCSkeletonWebGLRenderCmd.js +165 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/extensions/spine/Spine.js +2239 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/external/box2d/box2d.js +10882 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/external/chipmunk/chipmunk.js +6196 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/external/pluginx/Plugin.js +254 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/external/pluginx/platform/facebook.js +557 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/external/pluginx/platform/facebook_sdk.js +151 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/external/socketio/socket.io.min.js +2 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/jsb_apis.js +618 -0
- data/lib/ccb/builder/templates/project/folder/frameworks/cocos2d-html5/moduleConfig.json +453 -0
- data/lib/ccb/builder/templates/project/folder/project.json +42 -0
- data/lib/ccb/builder/templates/project/folder/res/CloseNormal.png +0 -0
- data/lib/ccb/builder/templates/project/folder/res/CloseSelected.png +0 -0
- data/lib/ccb/builder/templates/project/folder/res/HelloWorld.png +0 -0
- data/lib/ccb/builder/templates/project/folder/res/favicon.ico +0 -0
- data/lib/ccb/builder/templates/project/folder/res/gameOver/cocos2d-html5.png +0 -0
- data/lib/ccb/builder/templates/project/folder/res/gameOver/gameOver.png +0 -0
- data/lib/ccb/builder/templates/project/folder/res/mainMenu/bg.png +0 -0
- data/lib/ccb/builder/templates/project/folder/res/mainMenu/menu.png +0 -0
- data/lib/ccb/builder/templates/project/folder/res/setting/menuTitle.png +0 -0
- data/lib/ccb/builder/templates/project/folder/res/shared/arial-14.fnt +182 -0
- data/lib/ccb/builder/templates/project/folder/res/shared/arial-14.png +0 -0
- data/lib/ccb/builder/templates/project/folder/res/sound/music/bgMusic.mp3 +0 -0
- data/lib/ccb/builder/templates/project/folder/src/about/layer/ABBackgroundLayer.js +23 -0
- data/lib/ccb/builder/templates/project/folder/src/about/layer/ABTouchLayer.js +51 -0
- data/lib/ccb/builder/templates/project/folder/src/about/scene/About.js +36 -0
- data/lib/ccb/builder/templates/project/folder/src/config/Level.js +7 -0
- data/lib/ccb/builder/templates/project/folder/src/gameOver/layer/GOBackgroundLayer.js +50 -0
- data/lib/ccb/builder/templates/project/folder/src/gameOver/layer/GOTouchLayer.js +51 -0
- data/lib/ccb/builder/templates/project/folder/src/gameOver/scene/GameOver.js +38 -0
- data/lib/ccb/builder/templates/project/folder/src/gamePlay/classes/LevelManager.js +21 -0
- data/lib/ccb/builder/templates/project/folder/src/gamePlay/layer/GPBackgroundLayer.js +25 -0
- data/lib/ccb/builder/templates/project/folder/src/gamePlay/layer/GPTouchLayer.js +51 -0
- data/lib/ccb/builder/templates/project/folder/src/gamePlay/scene/GamePlay.js +44 -0
- data/lib/ccb/builder/templates/project/folder/src/mainMenu/layer/MMBackgroundLayer.js +43 -0
- data/lib/ccb/builder/templates/project/folder/src/mainMenu/layer/MMMainMenuLayer.js +38 -0
- data/lib/ccb/builder/templates/project/folder/src/mainMenu/layer/MMTouchLayer.js +96 -0
- data/lib/ccb/builder/templates/project/folder/src/mainMenu/scene/MainMenu.js +45 -0
- data/lib/ccb/builder/templates/project/folder/src/resource.js +29 -0
- data/lib/ccb/builder/templates/project/folder/src/setting/layer/STBackgroundLayer.js +25 -0
- data/lib/ccb/builder/templates/project/folder/src/setting/layer/STTouchLayer.js +89 -0
- data/lib/ccb/builder/templates/project/folder/src/setting/scene/Setting.js +40 -0
- data/lib/ccb/builder/templates/project/index.html.tt +27 -0
- data/lib/ccb/builder/templates/project/main.js.tt +62 -0
- data/lib/ccb/cli.rb +32 -0
- data/lib/ccb/ext/method_hooker.rb +68 -0
- data/lib/ccb/ext/string_extention.rb +7 -0
- data/lib/ccb.rb +1 -0
- metadata +449 -0
@@ -0,0 +1,1268 @@
|
|
1
|
+
/****************************************************************************
|
2
|
+
Copyright (c) 2013-2014 Chukong Technologies Inc.
|
3
|
+
|
4
|
+
http://www.cocos2d-x.org
|
5
|
+
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
8
|
+
in the Software without restriction, including without limitation the rights
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
11
|
+
furnished to do so, subject to the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be included in
|
14
|
+
all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
|
+
THE SOFTWARE.
|
23
|
+
****************************************************************************/
|
24
|
+
|
25
|
+
/**
|
26
|
+
* Timeline Frame.
|
27
|
+
* base class
|
28
|
+
* @class
|
29
|
+
*/
|
30
|
+
ccs.Frame = ccs.Class.extend({
|
31
|
+
|
32
|
+
_frameIndex: null,
|
33
|
+
_tween: null,
|
34
|
+
_timeline: null,
|
35
|
+
_node: null,
|
36
|
+
|
37
|
+
ctor: function(){
|
38
|
+
this._frameIndex = 0;
|
39
|
+
this._tween = true;
|
40
|
+
this._timeline = null;
|
41
|
+
this._node = null;
|
42
|
+
},
|
43
|
+
|
44
|
+
_emitEvent: function(){
|
45
|
+
if (this._timeline){
|
46
|
+
this._timeline.getActionTimeline()._emitFrameEvent(this);
|
47
|
+
}
|
48
|
+
},
|
49
|
+
|
50
|
+
_cloneProperty: function(frame){
|
51
|
+
this._frameIndex = frame.getFrameIndex();
|
52
|
+
this._tween = frame.isTween();
|
53
|
+
},
|
54
|
+
|
55
|
+
/**
|
56
|
+
* Set the frame index
|
57
|
+
* @param {number} frameIndex
|
58
|
+
*/
|
59
|
+
setFrameIndex: function(frameIndex){
|
60
|
+
this._frameIndex = frameIndex;
|
61
|
+
},
|
62
|
+
|
63
|
+
/**
|
64
|
+
* Get the frame index
|
65
|
+
* @returns {null}
|
66
|
+
*/
|
67
|
+
getFrameIndex: function(){
|
68
|
+
return this._frameIndex;
|
69
|
+
},
|
70
|
+
|
71
|
+
/**
|
72
|
+
* Set timeline
|
73
|
+
* @param timeline
|
74
|
+
*/
|
75
|
+
setTimeline: function(timeline){
|
76
|
+
this._timeline = timeline;
|
77
|
+
},
|
78
|
+
|
79
|
+
/**
|
80
|
+
* Get timeline
|
81
|
+
* @param timeline
|
82
|
+
* @returns {ccs.timeline}
|
83
|
+
*/
|
84
|
+
getTimeline: function(timeline){
|
85
|
+
return this._timeline;
|
86
|
+
},
|
87
|
+
|
88
|
+
/**
|
89
|
+
* Set Node
|
90
|
+
* @param {cc.Node} node
|
91
|
+
*/
|
92
|
+
setNode: function(node){
|
93
|
+
this._node = node;
|
94
|
+
},
|
95
|
+
|
96
|
+
/**
|
97
|
+
* gets the Node
|
98
|
+
* @return node
|
99
|
+
*/
|
100
|
+
getNode: function(){
|
101
|
+
return this._node;
|
102
|
+
},
|
103
|
+
|
104
|
+
/**
|
105
|
+
* set tween
|
106
|
+
* @param tween
|
107
|
+
*/
|
108
|
+
setTween: function(tween){
|
109
|
+
this._tween = tween;
|
110
|
+
},
|
111
|
+
|
112
|
+
/**
|
113
|
+
* Gets the tween
|
114
|
+
* @returns {boolean | null}
|
115
|
+
*/
|
116
|
+
isTween: function(){
|
117
|
+
return this._tween;
|
118
|
+
},
|
119
|
+
|
120
|
+
/**
|
121
|
+
* the execution of the callback
|
122
|
+
* @override
|
123
|
+
* @param {ccs.Frame} nextFrame
|
124
|
+
*/
|
125
|
+
onEnter: function(nextFrame){ // = 0
|
126
|
+
},
|
127
|
+
|
128
|
+
/**
|
129
|
+
* Each frame logic
|
130
|
+
* @override
|
131
|
+
* @param {number} percent
|
132
|
+
*/
|
133
|
+
apply: function(percent){
|
134
|
+
},
|
135
|
+
|
136
|
+
/**
|
137
|
+
* to copy object with deep copy.
|
138
|
+
* returns a clone of action.
|
139
|
+
* @override
|
140
|
+
* @return {ccs.Frame}
|
141
|
+
*/
|
142
|
+
clone: function(){ // = 0
|
143
|
+
}
|
144
|
+
});
|
145
|
+
|
146
|
+
/**
|
147
|
+
* Visible frame
|
148
|
+
* To control the display state
|
149
|
+
* @class
|
150
|
+
* @extend ccs.Frame
|
151
|
+
*/
|
152
|
+
ccs.VisibleFrame = ccs.Frame.extend({
|
153
|
+
|
154
|
+
_visible: true,
|
155
|
+
|
156
|
+
ctor: function(){
|
157
|
+
ccs.Frame.prototype.ctor.call(this);
|
158
|
+
this._visible = true;
|
159
|
+
},
|
160
|
+
|
161
|
+
/**
|
162
|
+
* the execution of the callback
|
163
|
+
* @param {ccs.Frame} nextFrame
|
164
|
+
*/
|
165
|
+
onEnter: function(nextFrame){
|
166
|
+
this._node.setVisible(this._visible);
|
167
|
+
},
|
168
|
+
|
169
|
+
/**
|
170
|
+
* to copy object with deep copy.
|
171
|
+
* returns a clone of action.
|
172
|
+
* @return {ccs.VisibleFrame}
|
173
|
+
*/
|
174
|
+
clone: function(){
|
175
|
+
var frame = new ccs.VisibleFrame();
|
176
|
+
frame.setVisible(this._visible);
|
177
|
+
|
178
|
+
frame._cloneProperty(this);
|
179
|
+
|
180
|
+
return frame;
|
181
|
+
},
|
182
|
+
|
183
|
+
/**
|
184
|
+
* Set display state
|
185
|
+
* @param {Boolean} visible
|
186
|
+
*/
|
187
|
+
setVisible: function(visible){
|
188
|
+
this._visible = visible;
|
189
|
+
},
|
190
|
+
|
191
|
+
/**
|
192
|
+
* Get the display state
|
193
|
+
* @returns {Boolean}
|
194
|
+
*/
|
195
|
+
isVisible: function(){
|
196
|
+
return this._visible;
|
197
|
+
}
|
198
|
+
|
199
|
+
});
|
200
|
+
|
201
|
+
/**
|
202
|
+
* Create the visible frame
|
203
|
+
*
|
204
|
+
* @deprecated v3.0, please use new ccs.VisibleFrame() instead.
|
205
|
+
* @returns {ccs.VisibleFrame}
|
206
|
+
*/
|
207
|
+
ccs.VisibleFrame.create = function(){
|
208
|
+
return new ccs.VisibleFrame();
|
209
|
+
};
|
210
|
+
|
211
|
+
/**
|
212
|
+
* Texture frame
|
213
|
+
* @class
|
214
|
+
* @extend ccs.Frame
|
215
|
+
*/
|
216
|
+
ccs.TextureFrame = ccs.Frame.extend({
|
217
|
+
|
218
|
+
_sprite: null,
|
219
|
+
_textureName: null,
|
220
|
+
|
221
|
+
ctor: function(){
|
222
|
+
ccs.Frame.prototype.ctor.call(this);
|
223
|
+
|
224
|
+
this._textureName = "";
|
225
|
+
},
|
226
|
+
|
227
|
+
/**
|
228
|
+
* Set the node element to draw texture
|
229
|
+
* @param {cc.Node} node
|
230
|
+
*/
|
231
|
+
setNode: function(node){
|
232
|
+
ccs.Frame.prototype.setNode.call(this, node);
|
233
|
+
this._sprite = node;
|
234
|
+
},
|
235
|
+
|
236
|
+
/**
|
237
|
+
* the execution of the callback
|
238
|
+
* @param {ccs.Frame} nextFrame
|
239
|
+
*/
|
240
|
+
onEnter: function(nextFrame){
|
241
|
+
if(this._sprite){
|
242
|
+
var spriteFrame = cc.spriteFrameCache._spriteFrames[this._textureName];
|
243
|
+
if(spriteFrame != null)
|
244
|
+
this._sprite.setSpriteFrame(spriteFrame);
|
245
|
+
else
|
246
|
+
this._sprite.setTexture(this._textureName);
|
247
|
+
}
|
248
|
+
|
249
|
+
},
|
250
|
+
|
251
|
+
/**
|
252
|
+
* to copy object with deep copy.
|
253
|
+
* returns a clone of action.
|
254
|
+
* @return {ccs.TextureFrame}
|
255
|
+
*/
|
256
|
+
clone: function(){
|
257
|
+
var frame = new ccs.TextureFrame();
|
258
|
+
frame.setTextureName(this._textureName);
|
259
|
+
frame._cloneProperty(this);
|
260
|
+
return frame;
|
261
|
+
},
|
262
|
+
|
263
|
+
/**
|
264
|
+
* Set the texture name
|
265
|
+
* @param {string} textureName
|
266
|
+
*/
|
267
|
+
setTextureName: function(textureName){
|
268
|
+
this._textureName = textureName;
|
269
|
+
},
|
270
|
+
|
271
|
+
/**
|
272
|
+
* Gets the Texture name
|
273
|
+
* @returns {null}
|
274
|
+
*/
|
275
|
+
getTextureName: function(){
|
276
|
+
return this._textureName;
|
277
|
+
}
|
278
|
+
|
279
|
+
});
|
280
|
+
|
281
|
+
/**
|
282
|
+
* Create the Texture frame
|
283
|
+
*
|
284
|
+
* @deprecated v3.0, please use new ccs.TextureFrame() instead.
|
285
|
+
* @returns {ccs.TextureFrame}
|
286
|
+
*/
|
287
|
+
ccs.TextureFrame.create = function(){
|
288
|
+
return new ccs.TextureFrame();
|
289
|
+
};
|
290
|
+
|
291
|
+
/**
|
292
|
+
* Rotation Frame
|
293
|
+
* @class
|
294
|
+
* @extend ccs.Frame
|
295
|
+
*/
|
296
|
+
ccs.RotationFrame = ccs.Frame.extend({
|
297
|
+
|
298
|
+
_rotation: null,
|
299
|
+
_betwennRotation: null,
|
300
|
+
|
301
|
+
ctor: function(){
|
302
|
+
ccs.Frame.prototype.ctor.call(this);
|
303
|
+
this._rotation = 0;
|
304
|
+
},
|
305
|
+
|
306
|
+
/**
|
307
|
+
* the execution of the callback
|
308
|
+
* @param {ccs.Frame} nextFrame
|
309
|
+
*/
|
310
|
+
onEnter: function(nextFrame){
|
311
|
+
this._node.setRotation(this._rotation);
|
312
|
+
|
313
|
+
if(this._tween){
|
314
|
+
this._betwennRotation = nextFrame._rotation - this._rotation;
|
315
|
+
}
|
316
|
+
},
|
317
|
+
|
318
|
+
/**
|
319
|
+
* Each frame logic
|
320
|
+
* @param {number} percent
|
321
|
+
*/
|
322
|
+
apply: function(percent){
|
323
|
+
if (this._tween && this._betwennRotation != 0){
|
324
|
+
var rotation = this._rotation + percent * this._betwennRotation;
|
325
|
+
this._node.setRotation(rotation);
|
326
|
+
}
|
327
|
+
},
|
328
|
+
|
329
|
+
/**
|
330
|
+
* to copy object with deep copy.
|
331
|
+
* returns a clone of action.
|
332
|
+
* @return {ccs.RotationFrame}
|
333
|
+
*/
|
334
|
+
clone: function(){
|
335
|
+
var frame = new ccs.RotationFrame();
|
336
|
+
frame.setRotation(this._rotation);
|
337
|
+
|
338
|
+
frame._cloneProperty(this);
|
339
|
+
|
340
|
+
return frame;
|
341
|
+
},
|
342
|
+
|
343
|
+
/**
|
344
|
+
* Set the rotation
|
345
|
+
* @param {Number} rotation
|
346
|
+
*/
|
347
|
+
setRotation: function(rotation){
|
348
|
+
this._rotation = rotation;
|
349
|
+
},
|
350
|
+
|
351
|
+
/**
|
352
|
+
* Gets the rotation
|
353
|
+
* @returns {Number}
|
354
|
+
*/
|
355
|
+
getRotation: function(){
|
356
|
+
return this._rotation;
|
357
|
+
}
|
358
|
+
|
359
|
+
});
|
360
|
+
|
361
|
+
/**
|
362
|
+
* Create the Rotation frame
|
363
|
+
*
|
364
|
+
* @deprecated v3.0, please use new ccs.RotationFrame() instead.
|
365
|
+
* @returns {ccs.RotationFrame}
|
366
|
+
*/
|
367
|
+
ccs.RotationFrame.create = function(){
|
368
|
+
return new ccs.RotationFrame();
|
369
|
+
};
|
370
|
+
|
371
|
+
/**
|
372
|
+
* Skew frame
|
373
|
+
* @class
|
374
|
+
* @extend ccs.Frame
|
375
|
+
*/
|
376
|
+
ccs.SkewFrame = ccs.Frame.extend({
|
377
|
+
|
378
|
+
_skewX: null,
|
379
|
+
_skewY: null,
|
380
|
+
_betweenSkewX: null,
|
381
|
+
_betweenSkewY: null,
|
382
|
+
|
383
|
+
ctor: function(){
|
384
|
+
ccs.Frame.prototype.ctor.call(this);
|
385
|
+
this._skewX = 0;
|
386
|
+
this._skewY = 0;
|
387
|
+
},
|
388
|
+
|
389
|
+
/**
|
390
|
+
* the execution of the callback
|
391
|
+
* @param {ccs.Frame} nextFrame
|
392
|
+
*/
|
393
|
+
onEnter: function(nextFrame){
|
394
|
+
this._node.setSkewX(this._skewX);
|
395
|
+
this._node.setSkewY(this._skewY);
|
396
|
+
|
397
|
+
if(this._tween){
|
398
|
+
this._betweenSkewX = nextFrame._skewX - this._skewX;
|
399
|
+
this._betweenSkewY = nextFrame._skewY - this._skewY;
|
400
|
+
}
|
401
|
+
|
402
|
+
},
|
403
|
+
|
404
|
+
/**
|
405
|
+
* Each frame logic
|
406
|
+
* @param {number} percent
|
407
|
+
*/
|
408
|
+
apply: function(percent){
|
409
|
+
if (this._tween && (this._betweenSkewX != 0 || this._betweenSkewY != 0))
|
410
|
+
{
|
411
|
+
var skewx = this._skewX + percent * this._betweenSkewX;
|
412
|
+
var skewy = this._skewY + percent * this._betweenSkewY;
|
413
|
+
|
414
|
+
this._node.setSkewX(skewx);
|
415
|
+
this._node.setSkewY(skewy);
|
416
|
+
}
|
417
|
+
},
|
418
|
+
|
419
|
+
/**
|
420
|
+
* to copy object with deep copy.
|
421
|
+
* returns a clone of action.
|
422
|
+
* @return {ccs.SkewFrame}
|
423
|
+
*/
|
424
|
+
clone: function(){
|
425
|
+
var frame = new ccs.SkewFrame();
|
426
|
+
frame.setSkewX(this._skewX);
|
427
|
+
frame.setSkewY(this._skewY);
|
428
|
+
|
429
|
+
frame._cloneProperty(this);
|
430
|
+
|
431
|
+
return frame;
|
432
|
+
},
|
433
|
+
|
434
|
+
/**
|
435
|
+
* Set the skew x
|
436
|
+
* @param {Number} skewx
|
437
|
+
*/
|
438
|
+
setSkewX: function(skewx){
|
439
|
+
this._skewX = skewx;
|
440
|
+
},
|
441
|
+
|
442
|
+
/**
|
443
|
+
* Gets the skew x
|
444
|
+
* @returns {Number}
|
445
|
+
*/
|
446
|
+
getSkewX: function(){
|
447
|
+
return this._skewX;
|
448
|
+
},
|
449
|
+
|
450
|
+
/**
|
451
|
+
* Set the skew y
|
452
|
+
* @param {Number} skewy
|
453
|
+
*/
|
454
|
+
setSkewY: function(skewy){
|
455
|
+
this._skewY = skewy;
|
456
|
+
},
|
457
|
+
|
458
|
+
/**
|
459
|
+
* Gets the skew y
|
460
|
+
* @returns {Number}
|
461
|
+
*/
|
462
|
+
getSkewY: function(){
|
463
|
+
return this._skewY;
|
464
|
+
}
|
465
|
+
|
466
|
+
});
|
467
|
+
|
468
|
+
/**
|
469
|
+
* Create the Skew frame
|
470
|
+
*
|
471
|
+
* @deprecated v3.0, please use new ccs.SkewFrame() instead.
|
472
|
+
* @returns {ccs.SkewFrame}
|
473
|
+
*/
|
474
|
+
ccs.SkewFrame.create = function(){
|
475
|
+
return new ccs.SkewFrame();
|
476
|
+
};
|
477
|
+
|
478
|
+
/**
|
479
|
+
* Rotation skew frame
|
480
|
+
* @class
|
481
|
+
* @extend ccs.SkewFrame
|
482
|
+
*/
|
483
|
+
ccs.RotationSkewFrame = ccs.SkewFrame.extend({
|
484
|
+
|
485
|
+
/**
|
486
|
+
* the execution of the callback
|
487
|
+
* @param {ccs.Frame} nextFrame
|
488
|
+
*/
|
489
|
+
onEnter: function(nextFrame){
|
490
|
+
|
491
|
+
this._node.setRotationX(this._skewX);
|
492
|
+
this._node.setRotationY(this._skewY);
|
493
|
+
|
494
|
+
if (this._tween)
|
495
|
+
{
|
496
|
+
this._betweenSkewX = nextFrame._skewX - this._skewX;
|
497
|
+
this._betweenSkewY = nextFrame._skewY - this._skewY;
|
498
|
+
}
|
499
|
+
|
500
|
+
},
|
501
|
+
|
502
|
+
/**
|
503
|
+
* Each frame logic
|
504
|
+
* @param {number} percent
|
505
|
+
*/
|
506
|
+
apply: function(percent){
|
507
|
+
if (this._tween && (this._betweenSkewX != 0 || this._betweenSkewY != 0)){
|
508
|
+
var skewx = this._skewX + percent * this._betweenSkewX;
|
509
|
+
var skewy = this._skewY + percent * this._betweenSkewY;
|
510
|
+
|
511
|
+
this._node.setRotationX(skewx);
|
512
|
+
this._node.setRotationY(skewy);
|
513
|
+
}
|
514
|
+
|
515
|
+
},
|
516
|
+
|
517
|
+
/**
|
518
|
+
* to copy object with deep copy.
|
519
|
+
* returns a clone of action.
|
520
|
+
* @return {ccs.RotationSkewFrame}
|
521
|
+
*/
|
522
|
+
clone: function(){
|
523
|
+
var frame = new ccs.RotationSkewFrame();
|
524
|
+
frame.setSkewX(this._skewX);
|
525
|
+
frame.setSkewY(this._skewY);
|
526
|
+
|
527
|
+
frame._cloneProperty(this);
|
528
|
+
|
529
|
+
return frame;
|
530
|
+
|
531
|
+
}
|
532
|
+
|
533
|
+
});
|
534
|
+
|
535
|
+
/**
|
536
|
+
* Create the RotationSkew frame
|
537
|
+
*
|
538
|
+
* @deprecated v3.0, please use new ccs.RotationSkewFrame() instead.
|
539
|
+
* @returns {ccs.RotationSkewFrame}
|
540
|
+
*/
|
541
|
+
ccs.RotationSkewFrame.create = function(){
|
542
|
+
return new ccs.RotationSkewFrame();
|
543
|
+
};
|
544
|
+
|
545
|
+
/**
|
546
|
+
* Position frame
|
547
|
+
* @class
|
548
|
+
* @extend ccs.Frame
|
549
|
+
*/
|
550
|
+
ccs.PositionFrame = ccs.Frame.extend({
|
551
|
+
|
552
|
+
_position: null,
|
553
|
+
_betweenX: null,
|
554
|
+
_betweenY: null,
|
555
|
+
|
556
|
+
ctor: function(){
|
557
|
+
ccs.Frame.prototype.ctor.call(this);
|
558
|
+
this._position = cc.p(0, 0);
|
559
|
+
},
|
560
|
+
|
561
|
+
/**
|
562
|
+
* the execution of the callback
|
563
|
+
* @param {ccs.Frame} nextFrame
|
564
|
+
*/
|
565
|
+
onEnter: function(nextFrame){
|
566
|
+
this._node.setPosition(this._position);
|
567
|
+
|
568
|
+
if(this._tween){
|
569
|
+
this._betweenX = nextFrame._position.x - this._position.x;
|
570
|
+
this._betweenY = nextFrame._position.y - this._position.y;
|
571
|
+
}
|
572
|
+
},
|
573
|
+
|
574
|
+
/**
|
575
|
+
* Each frame logic
|
576
|
+
* @param {number} percent
|
577
|
+
*/
|
578
|
+
apply: function(percent){
|
579
|
+
if (this._tween && (this._betweenX != 0 || this._betweenY != 0)){
|
580
|
+
var p = cc.p(0, 0);
|
581
|
+
p.x = this._position.x + this._betweenX * percent;
|
582
|
+
p.y = this._position.y + this._betweenY * percent;
|
583
|
+
|
584
|
+
this._node.setPosition(p);
|
585
|
+
}
|
586
|
+
},
|
587
|
+
|
588
|
+
/**
|
589
|
+
* to copy object with deep copy.
|
590
|
+
* returns a clone of action.
|
591
|
+
* @return {ccs.PositionFrame}
|
592
|
+
*/
|
593
|
+
clone: function(){
|
594
|
+
var frame = new ccs.PositionFrame();
|
595
|
+
frame.setPosition(this._position);
|
596
|
+
|
597
|
+
frame._cloneProperty(this);
|
598
|
+
|
599
|
+
return frame;
|
600
|
+
},
|
601
|
+
|
602
|
+
/**
|
603
|
+
* Set the position
|
604
|
+
* @param {cc.p} position
|
605
|
+
*/
|
606
|
+
setPosition: function(position){
|
607
|
+
this._position = position;
|
608
|
+
},
|
609
|
+
|
610
|
+
/**
|
611
|
+
* gets the position
|
612
|
+
* @returns {cc.p}
|
613
|
+
*/
|
614
|
+
getPosition: function(){
|
615
|
+
return this._position;
|
616
|
+
},
|
617
|
+
|
618
|
+
/**
|
619
|
+
* Set the position x
|
620
|
+
* @param {Number} x
|
621
|
+
*/
|
622
|
+
setX: function(x){
|
623
|
+
this._position.x = x;
|
624
|
+
},
|
625
|
+
|
626
|
+
/**
|
627
|
+
* Gets the postion x
|
628
|
+
* @returns {Number}
|
629
|
+
*/
|
630
|
+
getX: function(){
|
631
|
+
return this._position.x;
|
632
|
+
},
|
633
|
+
|
634
|
+
/**
|
635
|
+
* Set the position y
|
636
|
+
* @param {Number} y
|
637
|
+
*/
|
638
|
+
setY: function(y){
|
639
|
+
this._position.y = y;
|
640
|
+
},
|
641
|
+
|
642
|
+
/**
|
643
|
+
* Gets the position y
|
644
|
+
* @returns {Number}
|
645
|
+
*/
|
646
|
+
getY: function(){
|
647
|
+
return this._position.y;
|
648
|
+
}
|
649
|
+
|
650
|
+
});
|
651
|
+
|
652
|
+
/**
|
653
|
+
* Create the Position frame
|
654
|
+
*
|
655
|
+
* @deprecated v3.0, please use new ccs.PositionFrame() instead.
|
656
|
+
* @returns {ccs.PositionFrame}
|
657
|
+
*/
|
658
|
+
ccs.PositionFrame.create = function(){
|
659
|
+
return new ccs.PositionFrame();
|
660
|
+
};
|
661
|
+
|
662
|
+
/**
|
663
|
+
* Scale frame
|
664
|
+
* @class
|
665
|
+
* @xtend ccs.Frame
|
666
|
+
*/
|
667
|
+
ccs.ScaleFrame = ccs.Frame.extend({
|
668
|
+
|
669
|
+
_scaleX: null,
|
670
|
+
_scaleY: null,
|
671
|
+
_betweenScaleX: null,
|
672
|
+
_betweenScaleY: null,
|
673
|
+
|
674
|
+
ctor: function(){
|
675
|
+
ccs.Frame.prototype.ctor.call(this);
|
676
|
+
this._scaleX = 1;
|
677
|
+
this._scaleY = 1;
|
678
|
+
},
|
679
|
+
|
680
|
+
/**
|
681
|
+
* the execution of the callback
|
682
|
+
* @param {ccs.Frame} nextFrame
|
683
|
+
*/
|
684
|
+
onEnter: function(nextFrame){
|
685
|
+
this._node.setScaleX(this._scaleX);
|
686
|
+
this._node.setScaleY(this._scaleY);
|
687
|
+
|
688
|
+
if(this._tween){
|
689
|
+
this._betweenScaleX = nextFrame._scaleX - this._scaleX;
|
690
|
+
this._betweenScaleY = nextFrame._scaleY - this._scaleY;
|
691
|
+
}
|
692
|
+
|
693
|
+
},
|
694
|
+
|
695
|
+
/**
|
696
|
+
* Each frame logic
|
697
|
+
* @param {number} percent
|
698
|
+
*/
|
699
|
+
apply: function(percent){
|
700
|
+
if (this._tween && (this._betweenScaleX != 0 || this._betweenScaleY != 0)){
|
701
|
+
var scaleX = this._scaleX + this._betweenScaleX * percent;
|
702
|
+
var scaleY = this._scaleY + this._betweenScaleY * percent;
|
703
|
+
|
704
|
+
this._node.setScaleX(scaleX);
|
705
|
+
this._node.setScaleY(scaleY);
|
706
|
+
}
|
707
|
+
},
|
708
|
+
|
709
|
+
/**
|
710
|
+
* to copy object with deep copy.
|
711
|
+
* returns a clone of action.
|
712
|
+
* @return {ccs.ScaleFrame}
|
713
|
+
*/
|
714
|
+
clone: function(){
|
715
|
+
var frame = new ccs.ScaleFrame();
|
716
|
+
frame.setScaleX(this._scaleX);
|
717
|
+
frame.setScaleY(this._scaleY);
|
718
|
+
|
719
|
+
frame._cloneProperty(this);
|
720
|
+
|
721
|
+
return frame;
|
722
|
+
|
723
|
+
},
|
724
|
+
|
725
|
+
/**
|
726
|
+
* Set the scale
|
727
|
+
* @param {Number} scale
|
728
|
+
*/
|
729
|
+
setScale: function(scale){
|
730
|
+
this._scaleX = scale;
|
731
|
+
this._scaleY = scale;
|
732
|
+
},
|
733
|
+
|
734
|
+
/**
|
735
|
+
* Set the scale x
|
736
|
+
* @param {Number} scaleX
|
737
|
+
*/
|
738
|
+
setScaleX: function(scaleX){
|
739
|
+
this._scaleX = scaleX;
|
740
|
+
},
|
741
|
+
|
742
|
+
/**
|
743
|
+
* Gets the scale x
|
744
|
+
* @returns {Number}
|
745
|
+
*/
|
746
|
+
getScaleX: function(){
|
747
|
+
return this._scaleX;
|
748
|
+
},
|
749
|
+
|
750
|
+
/**
|
751
|
+
* Set the scale y
|
752
|
+
* @param {Number} scaleY
|
753
|
+
*/
|
754
|
+
setScaleY: function(scaleY){
|
755
|
+
this._scaleY = scaleY;
|
756
|
+
},
|
757
|
+
|
758
|
+
/**
|
759
|
+
* Gets the scale y
|
760
|
+
* @returns {Number}
|
761
|
+
*/
|
762
|
+
getScaleY: function(){
|
763
|
+
return this._scaleY;
|
764
|
+
}
|
765
|
+
|
766
|
+
});
|
767
|
+
|
768
|
+
/**
|
769
|
+
* Create the Scale frame
|
770
|
+
*
|
771
|
+
* @deprecated v3.0, please use new ccs.ScaleFrame() instead.
|
772
|
+
* @returns {ccs.ScaleFrame}
|
773
|
+
*/
|
774
|
+
ccs.ScaleFrame.create = function(){
|
775
|
+
return new ccs.ScaleFrame();
|
776
|
+
};
|
777
|
+
|
778
|
+
/**
|
779
|
+
* AnchorPoint frame
|
780
|
+
* @class
|
781
|
+
* @extend ccs.Frame
|
782
|
+
*/
|
783
|
+
ccs.AnchorPointFrame = ccs.Frame.extend({
|
784
|
+
|
785
|
+
_anchorPoint: null,
|
786
|
+
|
787
|
+
ctor: function(){
|
788
|
+
ccs.Frame.prototype.ctor.call(this);
|
789
|
+
this._anchorPoint = cc.p(0, 0);
|
790
|
+
},
|
791
|
+
|
792
|
+
/**
|
793
|
+
* the execution of the callback
|
794
|
+
* @param {ccs.Frame} nextFrame
|
795
|
+
*/
|
796
|
+
onEnter: function(nextFrame){
|
797
|
+
this._node.setAnchorPoint(this._anchorPoint);
|
798
|
+
},
|
799
|
+
|
800
|
+
/**
|
801
|
+
* to copy object with deep copy.
|
802
|
+
* returns a clone of action.
|
803
|
+
* @return {ccs.AnchorPointFrame}
|
804
|
+
*/
|
805
|
+
clone: function(){
|
806
|
+
var frame = new ccs.AnchorPointFrame();
|
807
|
+
frame.setAnchorPoint(this._anchorPoint);
|
808
|
+
|
809
|
+
frame._cloneProperty(this);
|
810
|
+
|
811
|
+
return frame;
|
812
|
+
},
|
813
|
+
|
814
|
+
/**
|
815
|
+
* Set the anchor point
|
816
|
+
* @param {cc.p} point
|
817
|
+
*/
|
818
|
+
setAnchorPoint: function(point){
|
819
|
+
this._anchorPoint = point;
|
820
|
+
},
|
821
|
+
|
822
|
+
/**
|
823
|
+
* Gets the anchor point
|
824
|
+
* @returns {cc.p}
|
825
|
+
*/
|
826
|
+
getAnchorPoint: function(){
|
827
|
+
return this._anchorPoint;
|
828
|
+
}
|
829
|
+
|
830
|
+
});
|
831
|
+
|
832
|
+
/**
|
833
|
+
* Create the AnchorPoint frame
|
834
|
+
*
|
835
|
+
* @deprecated v3.0, please use new ccs.AnchorPointFrame() instead.
|
836
|
+
* @returns {ccs.AnchorPointFrame}
|
837
|
+
*/
|
838
|
+
ccs.AnchorPointFrame.create = function(){
|
839
|
+
return new ccs.AnchorPointFrame();
|
840
|
+
};
|
841
|
+
|
842
|
+
/**
|
843
|
+
* Static param
|
844
|
+
* @namespace
|
845
|
+
*/
|
846
|
+
ccs.InnerActionType = {
|
847
|
+
LoopAction : 0,
|
848
|
+
NoLoopAction : 1,
|
849
|
+
SingleFrame : 2
|
850
|
+
};
|
851
|
+
|
852
|
+
/**
|
853
|
+
* Inner action frame
|
854
|
+
* @class
|
855
|
+
* @extend ccs.Frame
|
856
|
+
*/
|
857
|
+
ccs.InnerActionFrame = ccs.Frame.extend({
|
858
|
+
|
859
|
+
_innerActionType: null,
|
860
|
+
_startFrameIndex: null,
|
861
|
+
|
862
|
+
_endFrameIndex:0,
|
863
|
+
_singleFrameIndex: 0,
|
864
|
+
_enterWithName: false,
|
865
|
+
_animationName: "",
|
866
|
+
|
867
|
+
ctor: function(){
|
868
|
+
ccs.Frame.prototype.ctor.call(this);
|
869
|
+
|
870
|
+
this._innerActionType = ccs.InnerActionType.LoopAction;
|
871
|
+
this._startFrameIndex = 0;
|
872
|
+
},
|
873
|
+
|
874
|
+
/**
|
875
|
+
* the execution of the callback
|
876
|
+
* @param {ccs.Frame} nextFrame
|
877
|
+
*/
|
878
|
+
onEnter: function(nextFrame){
|
879
|
+
var innerActiontimeline = this._node.getActionByTag(this._node.getTag());
|
880
|
+
if (/*ccs.InnerActionType.SingleFrame*/"SingleFrame" == this._innerActionType){
|
881
|
+
innerActiontimeline.gotoFrameAndPause(this._singleFrameIndex);
|
882
|
+
return;
|
883
|
+
}
|
884
|
+
|
885
|
+
var innerStart = this._startFrameIndex;
|
886
|
+
var innerEnd = this._endFrameIndex;
|
887
|
+
if (this._enterWithName){
|
888
|
+
if (this._animationName == "-- ALL --"){
|
889
|
+
innerStart = 0;
|
890
|
+
innerEnd = innerActiontimeline.getDuration();
|
891
|
+
} else if(innerActiontimeline.IsAnimationInfoExists(this._animationName)) {
|
892
|
+
var info = innerActiontimeline.getAnimationInfo(this._animationName);
|
893
|
+
innerStart = info.startIndex;
|
894
|
+
innerEnd = info.endIndex;
|
895
|
+
}else{
|
896
|
+
cc.log("Animation %s not exists!", this._animationName);
|
897
|
+
}
|
898
|
+
}
|
899
|
+
|
900
|
+
var duration = this._timeline.getActionTimeline().getDuration();
|
901
|
+
var odddiff = duration - this._frameIndex - innerEnd + innerStart;
|
902
|
+
if (odddiff < 0){
|
903
|
+
innerEnd += odddiff;
|
904
|
+
}
|
905
|
+
|
906
|
+
if (ccs.InnerActionType.NoLoopAction == this._innerActionType){
|
907
|
+
innerActiontimeline.gotoFrameAndPlay(innerStart, innerEnd, false);
|
908
|
+
}else if (ccs.InnerActionType.LoopAction == this._innerActionType){
|
909
|
+
innerActiontimeline.gotoFrameAndPlay(innerStart, innerEnd, true);
|
910
|
+
}
|
911
|
+
},
|
912
|
+
|
913
|
+
setAnimationName: function(animationName){
|
914
|
+
if(!this._enterWithName){
|
915
|
+
cc.log(" cannot set aniamtioname when enter frame with index. setEnterWithName true firstly!");
|
916
|
+
}else{
|
917
|
+
this._animationName = animationName;
|
918
|
+
}
|
919
|
+
},
|
920
|
+
|
921
|
+
setSingleFrameIndex: function(frameIndex){
|
922
|
+
this._singleFrameIndex = frameIndex;
|
923
|
+
},
|
924
|
+
|
925
|
+
getSingleFrameIndex: function(){
|
926
|
+
return this._startFrameIndex;
|
927
|
+
},
|
928
|
+
|
929
|
+
setEnterWithName: function(isEnterWithName){
|
930
|
+
this._enterWithName = isEnterWithName;
|
931
|
+
},
|
932
|
+
|
933
|
+
getEnterWithName: function(){
|
934
|
+
return this._enterWithName;
|
935
|
+
},
|
936
|
+
|
937
|
+
/**
|
938
|
+
* to copy object with deep copy.
|
939
|
+
* returns a clone of action.
|
940
|
+
* @return {ccs.InnerActionFrame}
|
941
|
+
*/
|
942
|
+
clone: function(){
|
943
|
+
var frame = new ccs.InnerActionFrame();
|
944
|
+
frame.setInnerActionType(this._innerActionType);
|
945
|
+
frame.setStartFrameIndex(this._startFrameIndex);
|
946
|
+
|
947
|
+
frame._cloneProperty(this);
|
948
|
+
|
949
|
+
return frame;
|
950
|
+
|
951
|
+
},
|
952
|
+
|
953
|
+
/**
|
954
|
+
* Set the inner action type
|
955
|
+
* @param {ccs.InnerActionType} type
|
956
|
+
*/
|
957
|
+
setInnerActionType: function(type){
|
958
|
+
this._innerActionType = type;
|
959
|
+
},
|
960
|
+
|
961
|
+
/**
|
962
|
+
* Gets the inner action type
|
963
|
+
* @returns {ccs.InnerActionType}
|
964
|
+
*/
|
965
|
+
getInnerActionType: function(){
|
966
|
+
return this._innerActionType;
|
967
|
+
},
|
968
|
+
|
969
|
+
/**
|
970
|
+
* Set the start frame index
|
971
|
+
* @param {Number} frameIndex
|
972
|
+
*/
|
973
|
+
setStartFrameIndex: function(frameIndex){
|
974
|
+
this._startFrameIndex = frameIndex;
|
975
|
+
},
|
976
|
+
|
977
|
+
/**
|
978
|
+
* Get the start frame index
|
979
|
+
* @returns {Number}
|
980
|
+
*/
|
981
|
+
getStartFrameIndex: function(){
|
982
|
+
return this._startFrameIndex;
|
983
|
+
}
|
984
|
+
|
985
|
+
});
|
986
|
+
|
987
|
+
/**
|
988
|
+
* Create the InnerAction frame
|
989
|
+
*
|
990
|
+
* @deprecated v3.0, please use new ccs.InnerActionFrame() instead.
|
991
|
+
* @returns {ccs.InnerActionFrame}
|
992
|
+
*/
|
993
|
+
ccs.InnerActionFrame.create = function(){
|
994
|
+
return new ccs.InnerActionFrame();
|
995
|
+
};
|
996
|
+
|
997
|
+
/**
|
998
|
+
* Color frame
|
999
|
+
* @class
|
1000
|
+
* @extend ccs.Frame
|
1001
|
+
*/
|
1002
|
+
ccs.ColorFrame = ccs.Frame.extend({
|
1003
|
+
|
1004
|
+
_alpha: null,
|
1005
|
+
_color: null,
|
1006
|
+
|
1007
|
+
_betweenAlpha: null,
|
1008
|
+
_betweenRed: null,
|
1009
|
+
_betweenGreen: null,
|
1010
|
+
_betweenBlue: null,
|
1011
|
+
|
1012
|
+
ctor: function(){
|
1013
|
+
ccs.Frame.prototype.ctor.call(this);
|
1014
|
+
this._color = cc.color(255, 255, 255);
|
1015
|
+
},
|
1016
|
+
|
1017
|
+
/**
|
1018
|
+
* the execution of the callback
|
1019
|
+
* @param {ccs.ColorFrame} nextFrame
|
1020
|
+
*/
|
1021
|
+
onEnter: function(nextFrame){
|
1022
|
+
this._node.setColor(this._color);
|
1023
|
+
if(this._tween){
|
1024
|
+
var color = nextFrame._color;
|
1025
|
+
this._betweenRed = color.r - this._color.r;
|
1026
|
+
this._betweenGreen = color.g - this._color.g;
|
1027
|
+
this._betweenBlue = color.b - this._color.b;
|
1028
|
+
}
|
1029
|
+
|
1030
|
+
},
|
1031
|
+
|
1032
|
+
/**
|
1033
|
+
* Each frame logic
|
1034
|
+
* @param {number} percent
|
1035
|
+
*/
|
1036
|
+
apply: function(percent){
|
1037
|
+
if (this._tween && (this._betweenAlpha !=0 || this._betweenRed != 0 || this._betweenGreen != 0 || this._betweenBlue != 0)){
|
1038
|
+
|
1039
|
+
var color = cc.color(255, 255, 255);
|
1040
|
+
color.r = this._color.r + this._betweenRed * percent;
|
1041
|
+
color.g = this._color.g + this._betweenGreen * percent;
|
1042
|
+
color.b = this._color.b + this._betweenBlue * percent;
|
1043
|
+
|
1044
|
+
this._node.setColor(color);
|
1045
|
+
if(this._alpha != null){
|
1046
|
+
var alpha = this._alpha + this._betweenAlpha * percent;
|
1047
|
+
this._node.setOpacity(alpha);
|
1048
|
+
}
|
1049
|
+
|
1050
|
+
}
|
1051
|
+
},
|
1052
|
+
|
1053
|
+
/**
|
1054
|
+
* to copy object with deep copy.
|
1055
|
+
* returns a clone of action.
|
1056
|
+
* @return {ccs.ColorFrame}
|
1057
|
+
*/
|
1058
|
+
clone: function(){
|
1059
|
+
var frame = new ccs.ColorFrame();
|
1060
|
+
frame.setColor(this._color);
|
1061
|
+
frame._cloneProperty(this);
|
1062
|
+
return frame;
|
1063
|
+
},
|
1064
|
+
|
1065
|
+
/**
|
1066
|
+
* Set the color
|
1067
|
+
* @param {cc.color} color
|
1068
|
+
*/
|
1069
|
+
setColor: function(color){
|
1070
|
+
this._color = color;
|
1071
|
+
},
|
1072
|
+
|
1073
|
+
/**
|
1074
|
+
* Gets the color
|
1075
|
+
* @returns {cc.color}
|
1076
|
+
*/
|
1077
|
+
getColor: function(){
|
1078
|
+
return this._color;
|
1079
|
+
}
|
1080
|
+
|
1081
|
+
});
|
1082
|
+
|
1083
|
+
/**
|
1084
|
+
* Create the Color frame
|
1085
|
+
*
|
1086
|
+
* @deprecated v3.0, please use new ccs.ColorFrame() instead.
|
1087
|
+
* @returns {ccs.ColorFrame}
|
1088
|
+
*/
|
1089
|
+
ccs.ColorFrame.create = function(){
|
1090
|
+
return new ccs.ColorFrame();
|
1091
|
+
};
|
1092
|
+
|
1093
|
+
/**
|
1094
|
+
* Alpha frame
|
1095
|
+
* @class
|
1096
|
+
* @extend ccs.Frame
|
1097
|
+
*/
|
1098
|
+
ccs.AlphaFrame = ccs.Frame.extend({
|
1099
|
+
|
1100
|
+
_alpha: null,
|
1101
|
+
_betweenAlpha: null,
|
1102
|
+
|
1103
|
+
ctor: function(){
|
1104
|
+
ccs.Frame.prototype.ctor.call(this);
|
1105
|
+
this._alpha = 255;
|
1106
|
+
},
|
1107
|
+
|
1108
|
+
onEnter: function(nextFrame){
|
1109
|
+
this._node.setOpacity(this._alpha);
|
1110
|
+
if(this._tween){
|
1111
|
+
this._betweenAlpha = nextFrame._alpha - this._alpha;
|
1112
|
+
}
|
1113
|
+
},
|
1114
|
+
|
1115
|
+
apply: function(percent){
|
1116
|
+
if (this._tween){
|
1117
|
+
var alpha = this._alpha + this._betweenAlpha * percent;
|
1118
|
+
this._node.setOpacity(alpha);
|
1119
|
+
}
|
1120
|
+
},
|
1121
|
+
|
1122
|
+
/**
|
1123
|
+
* Set the alpha
|
1124
|
+
* @param {Number} alpha
|
1125
|
+
*/
|
1126
|
+
setAlpha: function(alpha){
|
1127
|
+
this._alpha = alpha;
|
1128
|
+
},
|
1129
|
+
|
1130
|
+
/**
|
1131
|
+
* Gets the alpha
|
1132
|
+
* @returns {Number}
|
1133
|
+
*/
|
1134
|
+
getAlpha: function(){
|
1135
|
+
return this._alpha;
|
1136
|
+
},
|
1137
|
+
|
1138
|
+
clone: function(){
|
1139
|
+
var frame = new ccs.AlphaFrame();
|
1140
|
+
frame.setAlpha(this._alpha);
|
1141
|
+
frame._cloneProperty(this);
|
1142
|
+
return frame;
|
1143
|
+
}
|
1144
|
+
});
|
1145
|
+
|
1146
|
+
/**
|
1147
|
+
* Event frame
|
1148
|
+
* @class
|
1149
|
+
* @extend ccs.Frame
|
1150
|
+
*/
|
1151
|
+
ccs.EventFrame = ccs.Frame.extend({
|
1152
|
+
|
1153
|
+
_event: null,
|
1154
|
+
|
1155
|
+
ctor: function(){
|
1156
|
+
ccs.Frame.prototype.ctor.call(this);
|
1157
|
+
this._event = "";
|
1158
|
+
},
|
1159
|
+
|
1160
|
+
/**
|
1161
|
+
* the execution of the callback
|
1162
|
+
* @param {ccs.Frame} nextFrame
|
1163
|
+
*/
|
1164
|
+
onEnter: function(nextFrame){
|
1165
|
+
this._emitEvent();
|
1166
|
+
},
|
1167
|
+
|
1168
|
+
/**
|
1169
|
+
* to copy object with deep copy.
|
1170
|
+
* returns a clone of action.
|
1171
|
+
* @return {ccs.EventFrame}
|
1172
|
+
*/
|
1173
|
+
clone: function(){
|
1174
|
+
var frame = new ccs.EventFrame();
|
1175
|
+
frame.setEvent(this._event);
|
1176
|
+
|
1177
|
+
frame._cloneProperty(this);
|
1178
|
+
|
1179
|
+
return frame;
|
1180
|
+
},
|
1181
|
+
|
1182
|
+
/**
|
1183
|
+
* Set the event
|
1184
|
+
* @param event
|
1185
|
+
*/
|
1186
|
+
setEvent: function(event){
|
1187
|
+
this._event = event;
|
1188
|
+
},
|
1189
|
+
|
1190
|
+
/**
|
1191
|
+
* Gets the event
|
1192
|
+
* @returns {null}
|
1193
|
+
*/
|
1194
|
+
getEvent: function(){
|
1195
|
+
return this._event;
|
1196
|
+
}
|
1197
|
+
|
1198
|
+
});
|
1199
|
+
|
1200
|
+
/**
|
1201
|
+
* Create the Event frame
|
1202
|
+
*
|
1203
|
+
* @deprecated v3.0, please use new ccs.EventFrame() instead.
|
1204
|
+
* @returns {ccs.EventFrame}
|
1205
|
+
*/
|
1206
|
+
ccs.EventFrame.create = function(){
|
1207
|
+
return new ccs.EventFrame();
|
1208
|
+
};
|
1209
|
+
|
1210
|
+
/**
|
1211
|
+
* zOrder frame
|
1212
|
+
* @class
|
1213
|
+
* @extend ccs.Frame
|
1214
|
+
*/
|
1215
|
+
ccs.ZOrderFrame = ccs.Frame.extend({
|
1216
|
+
|
1217
|
+
_zorder: null,
|
1218
|
+
|
1219
|
+
/**
|
1220
|
+
* the execution of the callback
|
1221
|
+
* @param {ccs.Frame} nextFrame
|
1222
|
+
*/
|
1223
|
+
onEnter: function(nextFrame){
|
1224
|
+
if(this._node)
|
1225
|
+
this._node.setLocalZOrder(this._zorder);
|
1226
|
+
},
|
1227
|
+
|
1228
|
+
/**
|
1229
|
+
* to copy object with deep copy.
|
1230
|
+
* returns a clone of action.
|
1231
|
+
* @return {ccs.ZOrderFrame}
|
1232
|
+
*/
|
1233
|
+
clone: function(){
|
1234
|
+
var frame = new ccs.ZOrderFrame();
|
1235
|
+
frame.setZOrder(this._zorder);
|
1236
|
+
|
1237
|
+
frame._cloneProperty(this);
|
1238
|
+
|
1239
|
+
return frame;
|
1240
|
+
},
|
1241
|
+
|
1242
|
+
/**
|
1243
|
+
* Set the zOrder
|
1244
|
+
* @param {Number} zorder
|
1245
|
+
*/
|
1246
|
+
setZOrder: function(zorder){
|
1247
|
+
this._zorder = zorder;
|
1248
|
+
},
|
1249
|
+
|
1250
|
+
/**
|
1251
|
+
* Gets the zOrder
|
1252
|
+
* @returns {Number}
|
1253
|
+
*/
|
1254
|
+
getZOrder: function(){
|
1255
|
+
return this._zorder;
|
1256
|
+
}
|
1257
|
+
|
1258
|
+
});
|
1259
|
+
|
1260
|
+
/**
|
1261
|
+
* Create the ZOrder frame
|
1262
|
+
*
|
1263
|
+
* @deprecated v3.0, please use new ccs.ZOrderFrame() instead.
|
1264
|
+
* @returns {ccs.ZOrderFrame}
|
1265
|
+
*/
|
1266
|
+
ccs.ZOrderFrame.create = function(){
|
1267
|
+
return new ccs.ZOrderFrame();
|
1268
|
+
};
|