{"version":3,"sources":["Users/smallmain/Documents/Work/cocos-service-pack-src/engine/gulp/browserify_prelude.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/DebugInfos.json","cocos2d-js.be84c.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/actions/CCAction.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/actions/CCActionCatmullRom.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/actions/CCActionEase.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/actions/CCActionInstant.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/actions/CCActionInterval.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/actions/CCActionManager.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/actions/index.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/actions/tween.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/animation/animation-animator.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/animation/animation-clip.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/animation/animation-curves.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/animation/animation-manager.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/animation/animation-state.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/animation/bezier.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/animation/easing.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/animation/index.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/animation/motion-path-helper.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/animation/playable.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/animation/types.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/CCDebug.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/CCDirector.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/CCGame.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/CCNode.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/CCPrivateNode.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/CCScene.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/CCScheduler.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/asset-manager/CCAssetManager.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/asset-manager/builtins.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/asset-manager/bundle.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/asset-manager/cache.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/asset-manager/config.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/asset-manager/depend-util.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/asset-manager/deprecated.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/asset-manager/deserialize.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/asset-manager/download-dom-audio.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/asset-manager/download-dom-image.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/asset-manager/download-file.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/asset-manager/download-script.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/asset-manager/downloader.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/asset-manager/factory.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/asset-manager/fetch.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/asset-manager/font-loader.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/asset-manager/helper.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/asset-manager/index.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/asset-manager/load.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/asset-manager/pack-manager.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/asset-manager/parser.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/asset-manager/pipeline.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/asset-manager/preprocess.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/asset-manager/releaseManager.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/asset-manager/request-item.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/asset-manager/shared.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/asset-manager/task.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/asset-manager/urlTransformer.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/asset-manager/utilities.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/assets/CCAsset.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/assets/CCAudioClip.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/assets/CCBitmapFont.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/assets/CCBufferAsset.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/assets/CCFont.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/assets/CCJsonAsset.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/assets/CCLabelAtlas.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/assets/CCPrefab.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/assets/CCRenderTexture.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/assets/CCSceneAsset.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/assets/CCScripts.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/assets/CCSpriteAtlas.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/assets/CCSpriteFrame.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/assets/CCTTFFont.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/assets/CCTextAsset.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/assets/CCTexture2D.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/assets/CCVideoClip.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/assets/index.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/assets/material/CCEffectAsset.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/assets/material/CCMaterial.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/assets/material/effect-base.ts","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/assets/material/effect-parser.ts","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/assets/material/effect-variant.ts","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/assets/material/effect.ts","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/assets/material/index.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/assets/material/material-pool.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/assets/material/material-variant.ts","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/assets/material/utils.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/base-ui/CCWidgetManager.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/camera/CCCamera.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/component-scheduler.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/components/CCAnimation.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/components/CCBlockInputEvents.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/components/CCButton.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/components/CCCanvas.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/components/CCComponent.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/components/CCComponentEventHandler.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/components/CCLabel.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/components/CCLabelOutline.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/components/CCLabelShadow.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/components/CCLayout.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/components/CCMask.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/components/CCMotionStreak.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/components/CCRenderComponent.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/components/CCRichText.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/components/CCScrollBar.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/components/CCScrollView.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/components/CCSlider.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/components/CCSprite.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/components/CCToggle.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/components/CCToggleContainer.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/components/CCToggleGroup.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/components/CCViewGroup.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/components/CCWidget.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/components/index.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/components/missing-script.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/event-manager/CCEvent.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/event-manager/CCEventListener.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/event-manager/CCEventManager.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/event-manager/CCTouch.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/event-manager/index.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/event/event-listeners.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/event/event-target.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/event/event.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/event/index.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/event/system-event.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/graphics/graphics.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/graphics/helper.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/graphics/index.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/graphics/types.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/index.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/node-activator.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/platform/CCClass.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/platform/CCClassDecorator.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/platform/CCEnum.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/platform/CCInputExtension.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/platform/CCInputManager.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/platform/CCMacro.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/platform/CCObject.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/platform/CCSAXParser.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/platform/CCScreen.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/platform/CCSys.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/platform/CCView.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/platform/CCVisibleRect.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/platform/attribute.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/platform/callbacks-invoker.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/platform/compiler.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/platform/deserialize-compiled.ts","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/platform/deserialize.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/platform/id-generater.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/platform/index.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/platform/instantiate-jit.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/platform/instantiate.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/platform/js.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/platform/preprocess-class.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/platform/requiring-frame.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/platform/utils.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/predefine.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/assembler-2d.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/assembler-pool.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/assembler.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/canvas/Device.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/canvas/Texture2D.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/index.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/render-flow.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/utils/dynamic-atlas/manager.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/utils/dynamic-atlas/reusable-atlas.ts","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/utils/label/bmfont.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/utils/label/label-frame.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/utils/label/letter-font.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/utils/label/ttf.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/utils/utils.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/webgl/assemblers/graphics/earcut.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/webgl/assemblers/graphics/impl.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/webgl/assemblers/graphics/index.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/webgl/assemblers/index.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/webgl/assemblers/label/2d-multi/bmfont.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/webgl/assemblers/label/2d-multi/ttf.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/webgl/assemblers/label/2d/bmfont.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/webgl/assemblers/label/2d/letter.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/webgl/assemblers/label/2d/nativeTTF.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/webgl/assemblers/label/2d/ttf.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/webgl/assemblers/label/index.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/webgl/assemblers/mask-assembler.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/webgl/assemblers/motion-streak-multi.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/webgl/assemblers/motion-streak.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/webgl/assemblers/sprite/2d-multi/bar-filled.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/webgl/assemblers/sprite/2d-multi/mesh.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/webgl/assemblers/sprite/2d-multi/radial-filled.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/webgl/assemblers/sprite/2d-multi/simple.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/webgl/assemblers/sprite/2d-multi/sliced.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/webgl/assemblers/sprite/2d-multi/tiled.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/webgl/assemblers/sprite/2d/bar-filled.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/webgl/assemblers/sprite/2d/mesh.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/webgl/assemblers/sprite/2d/radial-filled.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/webgl/assemblers/sprite/2d/simple.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/webgl/assemblers/sprite/2d/sliced.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/webgl/assemblers/sprite/2d/tiled.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/webgl/assemblers/sprite/index.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/webgl/flex-buffer.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/webgl/mesh-buffer.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/webgl/model-batcher.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/webgl/quad-buffer.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/webgl/render-data.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/webgl/spine-buffer.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/renderer/webgl/vertex-format.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/sp/index.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/sp/multi-batcher.ts","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/sp/multi-handler.ts","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/sp/sp.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/utils/CCPath.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/utils/affine-transform.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/utils/base-node.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/utils/binary-search.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/utils/blend-func.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/utils/decode-uuid.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/utils/find.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/utils/gray-sprite-state.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/utils/html-text-parser.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/utils/index.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/utils/misc.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/utils/mutable-forward-iterator.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/utils/pool.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/utils/prefab-helper.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/utils/profiler/CCProfiler.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/utils/profiler/counter.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/utils/profiler/perf-counter.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/utils/text-utils.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/utils/texture-util.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/utils/trans-pool/index.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/utils/trans-pool/mem-pool.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/utils/trans-pool/node-mem-pool.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/utils/trans-pool/node-unit.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/utils/trans-pool/unit-base.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/value-types/color.ts","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/value-types/index.ts","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/value-types/mat3.ts","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/value-types/mat4.ts","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/value-types/quat.ts","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/value-types/rect.ts","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/value-types/size.ts","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/value-types/trs.ts","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/value-types/utils.ts","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/value-types/value-type.ts","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/value-types/vec2.ts","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/value-types/vec3.ts","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/core/value-types/vec4.ts","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/deprecated.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/index.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/particle/CCParticleAsset.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/renderer/build/mappings/index.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/renderer/core/base-renderer.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/renderer/core/input-assembler.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/renderer/core/pass.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/renderer/core/program-lib.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/renderer/core/technique.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/renderer/core/view.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/renderer/enums.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/renderer/gfx/device.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/renderer/gfx/enums.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/renderer/gfx/frame-buffer.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/renderer/gfx/index-buffer.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/renderer/gfx/index.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/renderer/gfx/misc.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/renderer/gfx/program.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/renderer/gfx/render-buffer.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/renderer/gfx/state.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/renderer/gfx/texture-2d.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/renderer/gfx/texture-cube.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/renderer/gfx/texture.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/renderer/gfx/vertex-buffer.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/renderer/gfx/vertex-format.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/renderer/memop/circular-pool.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/renderer/memop/fixed-array.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/renderer/memop/index.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/renderer/memop/linked-array.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/renderer/memop/pool.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/renderer/memop/recycle-pool.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/renderer/memop/timsort.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/renderer/memop/typed-array-pool.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/renderer/murmurhash2_gc.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/renderer/renderers/forward-renderer.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/renderer/scene/camera.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/renderer/scene/model.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/renderer/scene/scene.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/renderer/types.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/cocos2d/tilemap/CCTiledMapAsset.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/extends.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/extensions/spine/AttachUtil.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/extensions/spine/Skeleton.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/extensions/spine/index.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/extensions/spine/lib/spine.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/extensions/spine/skeleton-cache.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/extensions/spine/skeleton-data.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/extensions/spine/skeleton-texture.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/extensions/spine/spine-assembler.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/extensions/spine/track-entry-listeners.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/extensions/spine/vertex-effect-delegate.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/index.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/polyfill/array-buffer.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/polyfill/array.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/polyfill/misc.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/polyfill/number.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/polyfill/object.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/polyfill/string.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/polyfill/typescript.js","Users/smallmain/Documents/Work/cocos-service-pack-src/engine/predefine.js"],"names":["outer","modules","cache","entry","newRequire","name","jumped","module","moduleData","exports","x","i","length","1","require","1001","1002","1003","1004","1005","1006","1007","1008","1009","1010","1011","1012","1013","1014","1015","1016","1019","1020","1021","1022","1023","1024","1025","1026","1027","1028","1029","1030","1031","1100","1101","1200","1201","1203","1204","1205","1206","1207","1208","1209","1210","1211","1212","1213","1214","1215","1216","1300","1400","1404","1405","1406","1408","1502","1503","1504","1505","1506","1507","1508","1509","1510","1511","1513","1605","1606","1610","1612","1613","1617","1618","1619","1620","1623","1624","1625","1626","1627","1632","1633","1634","1635","1636","1637","1638","1639","1800","1801","1802","1803","1900","2000","2200","2201","2300","2400","2602","2603","2606","2607","2608","2609","2610","2614","2616","2617","2618","2619","2623","2625","2626","2627","2628","2712","3005","3006","3007","3103","3112","3113","3116","3117","3119","3120","3121","3300","3400","3401","3500","3501","3502","3503","3504","3505","3506","3507","3508","3509","3510","3511","3600","3601","3602","3603","3604","3605","3606","3607","3608","3609","3610","3611","3612","3613","3614","3615","3616","3617","3618","3619","3620","3621","3622","3623","3624","3625","3626","3627","3628","3633","3634","3635","3636","3637","3638","3639","3640","3641","3642","3643","3644","3645","3646","3647","3648","3649","3651","3652","3653","3654","3655","3700","3701","3800","3801","3802","3803","3804","3805","3806","3807","3808","3809","3810","3811","3812","3813","3814","3815","3816","3817","3818","3819","3820","3821","3900","3901","3902","3903","3904","3905","3906","3907","3912","4003","4004","4011","4012","4013","4200","4201","4202","4300","4400","4600","4700","4800","4901","4902","4914","4915","4916","4921","4922","4923","4924","4925","4926","4927","4928","4929","4930","4932","4933","5000","5001","5100","5200","5201","5202","5300","5301","5302","5303","5304","5402","5403","5404","5405","5406","5500","5501","5507","5508","5510","5511","5512","5513","5514","5515","5516","5517","5601","5602","5603","5700","5800","5801","5802","5900","5901","5902","6000","6001","6017","6018","6019","6020","6021","6022","6023","6024","6025","6026","6027","6028","6029","6030","6031","6032","6400","6402","6500","6600","6601","6700","6800","6801","6900","6901","6902","6903","6904","6905","7100","7101","7200","7201","7202","7203","7210","7211","7215","7216","7217","7218","7219","7221","7222","7236","7237","7238","7239","7240","7241","7401","7402","7501","7502","7503","7504","7506","7507","7508","7509","7510","7600","7601","7602","7603","7604","7605","7700","7701","7702","7800","7801","7802","7803","7804","7805","7900","7901","7902","7903","7904","7905","7906","7907","7908","7909","8000","8001","8002","8003","8103","8104","8105","8106","8107","8108","8109","8200","8300","8301","8400","8401","9000","9001","9100","9101","9102","9103","9104","9105","9106","9107","9200","0100","2","misc","cc","Action","Class","ctor","this","originalTarget","target","tag","TAG_INVALID","clone","action","isDone","startWithTarget","stop","step","dt","logID","update","getTarget","setTarget","getOriginalTarget","setOriginalTarget","getTag","setTag","retain","release","FiniteTimeAction","extends","_duration","getDuration","_timesForRepeat","setDuration","duration","reverse","Speed","speed","_speed","_innerAction","initWithAction","getSpeed","setSpeed","errorID","prototype","call","setInnerAction","getInnerAction","Follow","followedNode","rect","_followedNode","_boundarySet","_boundaryFullyCovered","_halfScreenSize","_fullScreenSize","leftBoundary","rightBoundary","topBoundary","bottomBoundary","_worldRect","initWithTarget","locRect","Rect","y","width","height","isBoundarySet","setBoundarySet","value","setBoudarySet","_this","winSize","v2","mul","targetWorldPos","convertToWorldSpaceAR","Vec2","ZERO","followedWorldPos","delta","sub","tempPos","parent","convertToNodeSpaceAR","add","setPosition","clampf","activeInHierarchy","follow","../core/platform/CCClass","../core/utils/misc","3","cardinalSplineAt","p0","p1","p2","p3","tension","t","t2","t3","s","b1","b2","b3","b4","getControlPointAt","controlPoints","pos","p","Math","min","max","reverseControlPoints","newArray","push","cloneControlPoints","CardinalSplineTo","ActionInterval","points","_points","_deltaT","_tension","_previousPosition","_accumulatedDiff","undefined","initWithDuration","setPoints","_computeEaseTime","lt","ps","locDT","newPos","macro","ENABLE_STACKABLE_ACTIONS","tempX","tempY","locAccDiff","updatePosition","reversePoints","cardinalSplineTo","getPoints","CardinalSplineBy","_startPosition","copyConfig","slice","current","reverseArray","pop","unshift","cardinalSplineBy","posX","posY","a","CatmullRomTo","catmullRomTo","CatmullRomBy","catmullRomBy","4","easeIn","rate","_rate","easing","pow","easeOut","easeInOut","_easeExponentialInObj","_easeExponentialOutObj","easeExponentialIn","easeExponentialOut","_easeExponentialInOutObj","easeExponentialInOut","_easeSineInObj","cos","PI","_easeSineOutObj","easeSineIn","sin","easeSineOut","_easeSineInOutObj","easeSineInOut","_easeElasticInObj","_easeElasticOutObj","easeElasticIn","period","_period","easeElasticOut","easeElasticInOut","newT","locPeriod","_bounceTime","time1","_easeBounceInObj","_easeBounceOutObj","easeBounceIn","easeBounceOut","_easeBounceInOutObj","easeBounceInOut","_easeBackInObj","overshoot","_easeBackOutObj","easeBackIn","easeBackOut","_easeBackInOutObj","easeBackInOut","easeBezierAction","b","c","d","_easeQuadraticActionIn","time","easeQuadraticActionIn","_easeQuadraticActionOut","easeQuadraticActionOut","_easeQuadraticActionInOut","resultTime","easeQuadraticActionInOut","_easeQuarticActionIn","easeQuarticActionIn","_easeQuarticActionOut","easeQuarticActionOut","_easeQuarticActionInOut","easeQuarticActionInOut","_easeQuinticActionIn","easeQuinticActionIn","_easeQuinticActionOut","easeQuinticActionOut","_easeQuinticActionInOut","easeQuinticActionInOut","_easeCircleActionIn","sqrt","easeCircleActionIn","_easeCircleActionOut","easeCircleActionOut","_easeCircleActionInOut","easeCircleActionInOut","_easeCubicActionIn","easeCubicActionIn","_easeCubicActionOut","easeCubicActionOut","_easeCubicActionInOut","easeCubicActionInOut","5","ActionInstant","Show","_renderComps","getComponentsInChildren","RenderComponent","render","enabled","Hide","show","hide","ToggleVisibility","toggleVisibility","RemoveSelf","isNeedCleanUp","_isNeedCleanUp","init","removeFromParent","removeSelf","DestroySelf","destroy","destroySelf","FlipX","flip","_flippedX","initWithFlipX","scaleX","abs","flipX","FlipY","_flippedY","initWithFlipY","scaleY","flipY","Place","_x","_y","initWithPosition","place","CallFunc","selector","selectorTarget","data","_selectorTarget","_function","_data","initWithFunction","execute","getTargetCallback","setTargetCallback","sel","callFunc","6","MAX_VALUE","_elapsed","_firstTick","_easeList","_repeatForever","_repeatMethod","_speedMethod","getElapsed","FLT_EPSILON","_cloneDecoration","_reverseEaseList","easeObj","arguments","locList","n","setAmplitudeRate","amp","getAmplitudeRate","repeat","times","round","isNaN","repeatForever","actionInterval","Sequence","tempArray","_actions","_split","_last","_reversed","paramArray","Array","last","prev","action1","_actionOneTwo","initWithTwoActions","actionOne","actionTwo","durationOne","durationTwo","new_t","found","locSplit","locActions","locLast","actionFound","sequence","result","Repeat","_times","_total","_nextDt","_actionInstant","locInnerAction","locDuration","locTimes","locNextDt","RepeatForever","Spawn","_one","_two","action2","ret","d1","d2","delayTime","spawn","pSpawn","RotateTo","statics","_reverse","dstAngle","_startAngle","_dstAngle","_angle","startAngle","angle","rotateTo","RotateBy","deltaAngle","_deltaAngle","rotateBy","MoveBy","deltaPos","deltaY","_positionDelta","position","locPosX","locPosY","locStartPosition","targetX","targetY","locPreviousPosition","moveBy","MoveTo","_endPosition","moveTo","SkewTo","sx","sy","_skewX","_skewY","_startSkewX","_startSkewY","_endSkewX","_endSkewY","_deltaX","_deltaY","skewX","skewY","skewTo","SkewBy","deltaSkewX","deltaSkewY","skewBy","JumpBy","jumps","_delta","_height","_jumps","frac","jumpBy","JumpTo","jumpTo","bezierAt","BezierBy","_config","newConfigs","selConf","locConfig","xa","xb","xc","xd","ya","yb","yc","yd","x0","y0","x1","y1","x2","y2","r","bezierBy","BezierTo","_toConfig","locStartPos","locToConfig","bezierTo","ScaleTo","_scaleX","_scaleY","_startScaleX","_startScaleY","_endScaleX","_endScaleY","scaleTo","ScaleBy","scaleBy","Blink","blinks","_originalState","m","opacity","blink","FadeTo","_toOpacity","_fromOpacity","fromOpacity","fadeTo","FadeIn","_reverseAction","FadeOut","fadeIn","fadeOut","TintTo","red","green","blue","_to","color","_from","Color","g","locTo","locFrom","tintTo","TintBy","deltaRed","deltaGreen","deltaBlue","_deltaR","_deltaG","_deltaB","_fromR","_fromG","_fromB","tintBy","DelayTime","ReverseTime","_other","reverseTime","TargetedAction","_action","_forcedTarget","getForcedTarget","setForcedTarget","forcedTarget","targetedAction","7","js","HashElement","actions","actionIndex","currentAction","paused","lock","ActionManager","_hashTargets","createMap","_arrayTargets","_currentTarget","director","_scheduler","enableForTarget","constructor","_elementPool","_searchElementByTarget","arr","k","_getElement","element","_putElement","addAction","_id","removeAllActions","locTargets","removeAllActionsFromTarget","forceDelete","_deleteHashElement","removeAction","splice","_removeActionByTag","l","_removeActionAtIndex","_removeAllActionsByTag","removeActionByTag","hashTargets","_element","removeAllActionsByTag","_element2","getActionByTag","getNumberOfRunningActionsInTarget","pauseTarget","resumeTarget","pauseAllRunningActions","idsWithActions","resumeTargets","targetsToResume","pauseTargets","targetsToPause","purgeSharedManager","getScheduler","unscheduleUpdate","index","targets","locCurrTarget","elt","CC_TEST","../core/platform/js","8","./CCAction","./CCActionCatmullRom","./CCActionEase","./CCActionInstant","./CCActionInterval","./CCActionManager","./tween","9","_bezier","_tweenID","TweenAction","props","opts","_opts","Object","create","_props","progress","easingName","warnID","relative","isNumber","lerp","warn","prop","_originProps","start","end","easingTime","onUpdate","SetAction","Tween","_finalAction","_target","_tag","stopAll","getActionManager","stopAllByTag","stopAllByTarget","then","other","_union","isValid","tween","union","assign","c1","c2","to","c0x","c0y","c1x","c1y","bezier","by","_this2","tmp_args","wrapAction","arg","apply","set","delay","parallel","previousAsInputActions","keys","_loop","key","_loop2","_i","args","_i2","../animation/bezier","10","Playable","_require","EventAnimCurve","EventInfo","WrapModeMask","binarySearch","binarySearchEpsilon","AnimationAnimator","animation","_anims","array","MutableForwardIterator","extend","playState","state","startTime","clip","curveLoaded","initClipData","animator","play","setTime","stopStatesExcept","iterator","anim","stopState","addAnimation","indexOf","_setEventTarget","removeAnimation","fastRemoveAt","sample","pauseState","pause","resumeState","resume","isPaused","setStateTime","onStop","onPause","onResume","_reloadClip","createBatchedProperty","propPath","firstDotIndex","mainValue","animValue","nextValue","leftIndex","rightIndex","nextName","lastPropName","root","wrapMode","frameRate","Loop","repeatCount","Infinity","curves","createCurves","events","curve","eventData","ratio","frame","eventInfo","ratios","func","params","../core/utils/binary-search","./animation-curves","./playable","./types","11","WrapMode","DynamicAnimCurve","quickFindIndex","sampleMotionPaths","AnimationClip","Asset","properties","default","type","Float","get","Normal","curveData","visible","createWithSpriteFrames","spriteFrames","isArray","frames","comps","cc.Sprite","spriteFrame","onLoad","Number","parseFloat","parseInt","createPropCurve","keyframes","motionPaths","isMotionPathProp","Node","keyframe","motionPath","curveValue","values","curveTypes","types","Linear","Bezier","currRatioDif","lastRatioDif","canOptimize","EPSILON","_l","_findFrameIndex","firstValue","_lerp","_lerpNumber","Quat","_lerpQuat","_lerpVector2","Vec3","_lerpVector3","_lerpObject","createTargetCurves","propsData","compsData","compName","comp","getComponent","compData","_propPath","_curve","childrenCurveDatas","paths","namePath","find","childCurveDatas","./motion-path-helper","12","bezierByTime","WrappedInfo","computeRatioByType","AnimCurve","onTimeChangedManually","eachLength","floorIndex","_cachedIndex","from","out","quat","v3","frameCount","shoudRefind","cachedIndex","_fromRatio","_toRatio","fromVal","fromRatio","toRatio","ratioBetweenFrames","toVal","_wrappedInfo","_default","_lastWrappedInfo","_ignoreIndex","NaN","_wrapIterations","iterations","currentWrappedInfo","getWrappedInfo","direction","currentIndex","frameIndex","_fireEvent","currentIterations","lastWrappedInfo","lastIterations","lastIndex","lastDirection","interationsChanged","PingPong","getAnimationManager","pushDelayEvent","components","_components","event","funcName","j","component","info","./bezier","13","AnimationManager","_delayEvents","_isPlaying","_isPaused","destruct","14","Types","AnimationState","_currentFramePlayed","_delay","_delayTime","_process","process","_clip","_name","_lastframeEventOn","emit","proto","_emit","on","callback","once","self","off","hasEventListener","onPlay","lastInfo","stopped","simpleProcess","len","_lastIterations","_needRevers","needRevers","isEnd","isOddIteration","Reverse","tempRatio","tempTime","shouldWrap","_wrapMode","ShouldWrap","obsolete","getset","CC_EDITOR","_repeatCount","15","C1","C2","C3","C4","t1","acos","pi","tau","crt","v","cardano","pa","pb","pc","pd","pa3","pb3","pc3","rd","r3","a3","q","q2","discriminant","u1","v1","x3","mp3","mp33","cosphi","phi","crtr","sd","percent","p1y","p2y","16","constant","linear","quadIn","quadOut","quadInOut","cubicIn","cubicOut","cubicInOut","quartIn","quartOut","quartInOut","quintIn","quintOut","quintInOut","sineIn","sineOut","sineInOut","expoIn","expoOut","expoInOut","circIn","circOut","circInOut","elasticIn","asin","elasticOut","elasticInOut","backIn","backOut","backInOut","bounceIn","bounceOut","bounceInOut","smooth","fade","_makeOutIn","fnIn","fnOut","quadOutIn","cubicOutIn","quartOutIn","quintOutIn","sineOutIn","expoOutIn","circOutIn","backOutIn","bounceOutIn","17","./animation-animator","./animation-clip","./animation-manager","./animation-state","./easing","18","Curve","beziers","progresses","computeBeziers","startPoint","endPoint","startCtrlPoint","endCtrlPoint","getLength","getPointAt","u","getUtoTmapping","getPoint","lengths","getLengths","divisions","__arcLengthDivisions","cacheArcLengths","vector","sum","mag","distance","arcLengths","il","targetArcLength","low","high","comparison","floor","lengthBefore","lengthAfter","segmentLength","segmentFraction","checkMotionPath","controls","fps","createControlPoints","in","map","motionPathValid","_motionPath","newValues","newTypes","newRatios","addNewDatas","startRatioOffset","newType","nextRatio","betweenRatio","results","finalProgress","l2","normal","normalize","bezierIndex","newRatio","19","debug","_stepOnce","virtual","onError","getError","../core/CCDebug","20","Enum","Default","LoopReverse","PingPongReverse","21","utils","debugInfos","ERROR_MAP_URL","logList","log","error","assert","console","bind","resetDebugSetting","mode","DebugMode","NONE","ERROR","logToWebPage","msg","game","canvas","logDiv","document","createElement","setAttribute","logDivStyle","style","zIndex","top","left","logListStyle","backgroundColor","borderBottom","borderTopWidth","borderLeftWidth","borderRightWidth","borderTopStyle","borderLeftStyle","borderRightStyle","padding","margin","appendChild","parentNode","scrollTop","scrollHeight","formatStr","cond","shiftArguments","ERROR_FOR_WEB_PAGE","INFO_FOR_WEB_PAGE","CC_JSB","CC_DEV","Error","INFO","CC_RUNTIME","_throw","callInNextTick","getTypedFormatter","id","argsArray","concat","logFormatter","warnFormatter","errorFormatter","assertFormatter","assertID","WARN","WARN_FOR_WEB_PAGE","_resetDebugSetting","isDisplayStats","profiler","isShowingStats","setDisplayStats","displayStats","renderType","RENDER_TYPE_CANVAS","showStats","hideStats","config","showFPS","../../DebugInfos","./platform/utils","22","EventTarget","ComponentScheduler","NodeActivator","Obj","renderer","eventManager","Scheduler","Director","_paused","_purgeDirectorInNextLoop","_winSizeInPoints","_scene","_loadingScene","_totalFrames","_lastUpdate","_deltaTime","_startTime","_maxParticleDeltaTime","_compScheduler","_nodeActivator","_actionManager","EVENT_SHOW","performance","now","EVENT_ENGINE_INITED","size","scheduleUpdate","PRIORITY_SYSTEM","sharedInit","setEnabled","_animationManager","CollisionManager","_collisionManager","PhysicsManager","_physicsManager","Physics3DManager","CC_PHYSICS_BUILTIN","CC_PHYSICS_CANNON","_physics3DManager","_widgetManager","calculateDeltaTime","CC_DEBUG","convertToGL","uiPoint","container","view","box","getBoundingClientRect","window","pageXOffset","clientLeft","pageYOffset","clientTop","_devicePixelRatio","_isRotated","_viewportRect","convertToUI","glPoint","getWinSize","getWinSizeInPixels","purgeCachedData","assetManager","releaseAll","purgeDirector","unscheduleAll","reset","clear","builtins","runSceneImmediate","scene","onBeforeLoadScene","onLaunched","Scene","SceneAsset","CC_BUILD","_load","timeEnd","persistNodeList","_persistRootNodes","node","existNode","getChildByUuid","uuid","getSiblingIndex","_destroyImmediate","insertChild","oldScene","_releaseManager","_autoRelease","_deferredDestroy","EVENT_BEFORE_SCENE_LAUNCH","_activate","EVENT_AFTER_SCENE_LAUNCH","runScene","EVENT_AFTER_DRAW","loadScene","sceneName","_onUnloaded","bundle","bundles","getSceneInfo","EVENT_BEFORE_SCENE_LOADING","err","preloadScene","onProgress","onLoaded","setDepthTest","Camera","main","depth","setClearColor","clearColor","getRunningScene","getScene","getAnimationInterval","getFrameRate","setAnimationInterval","setFrameRate","getDeltaTime","getTotalTime","getTotalFrames","setScheduler","scheduler","setActionManager","actionManager","getCollisionManager","getPhysicsManager","getPhysics3DManager","startAnimation","stopAnimation","_resetDeltaTime","mainLoop","EVENT_BEFORE_UPDATE","startPhase","updatePhase","lateUpdatePhase","EVENT_AFTER_UPDATE","EVENT_BEFORE_DRAW","frameUpdateListeners","__fastOn","__fastOff","addon","EVENT_PROJECTION_CHANGED","EVENT_BEFORE_VISIT","EVENT_AFTER_VISIT","PROJECTION_2D","PROJECTION_3D","PROJECTION_CUSTOM","PROJECTION_DEFAULT","EVENT_BEFORE_PHYSICS","EVENT_AFTER_PHYSICS","./CCGame","./CCScheduler","./component-scheduler","./event-manager","./event/event-target","./node-activator","./platform/CCObject","./renderer","23","dynamicAtlasManager","EVENT_HIDE","EVENT_RESTART","EVENT_GAME_INITED","EVENT_RENDERER_INITED","RENDER_TYPE_WEBGL","RENDER_TYPE_OPENGL","_configLoaded","_isCloning","_prepared","_rendererInitialized","_renderContext","_intervalId","_lastTime","_frameTime","onStart","cancelAnimFrame","_setAnimFrame","_runMainLoop","audioEngine","_break","_restore","restart","removePersistRootNode","uncacheAll","close","_initEngine","_initRenderer","_initEvents","_loadPreviewScript","cb","CC_PREVIEW","_prepareFinished","ENGINE_VERSION","eventTargetOn","eventTargetOnce","prepare","run","_initConfig","addPersistRootNode","isNode","_persistNode","_addPersistNodeRef","_removePersistNodeRef","isPersistRootNode","rAF","requestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame","msRequestAnimationFrame","requestAnimFrame","_stTimeWithRAF","_stTime","_ctTime","cancelAnimationFrame","cancelRequestAnimationFrame","msCancelRequestAnimationFrame","mozCancelRequestAnimationFrame","oCancelRequestAnimationFrame","webkitCancelRequestAnimationFrame","msCancelAnimationFrame","mozCancelAnimationFrame","webkitCancelAnimationFrame","oCancelAnimationFrame","currTime","timeToCall","setTimeout","clearTimeout","_callback","skip","debugMode","exposeClassName","renderMode","registerSystemEvent","collisionMatrix","groupList","_determineRenderType","userRenderMode","supportRender","sys","capabilities","el","localCanvas","localContainer","addClass","hasClass","className","HTMLElement","querySelector","tagName","insertBefore","clientWidth","clientHeight","body","documentElement","stencil","antialias","ENABLE_WEBGL_ANTIALIAS","alpha","ENABLE_TRANSPARENT_CANVAS","initWebGL","device","_gl","CLEANUP_IMAGE_CACHE","initCanvas","_ctx","oncontextmenu","_isContextMenuEnable","win","hiddenPropName","internal","inputManager","hidden","mozHidden","msHidden","webkitHidden","onHidden","onShown","arg0","arg1","arg2","arg3","arg4","changeList","addEventListener","navigator","userAgent","onfocus","../audio/CCAudioEngine","../core/renderer/utils/dynamic-atlas/manager","./CCDebug","./renderer/index.js","24","_valueTypes","_utils","BaseNode","PrefabHelper","nodeMemPool","NodeMemPool","AffineTrans","Event","RenderFlow","Flags","Destroying","ERR_INVALID_NUMBER","ONE_DEGREE","ActionManagerExist","emptyFunc","_gwpVec3","_gwpQuat","_tpVec3a","_tpVec3b","_tpQuata","_tpQuatb","_swpVec3","_gwsVec3","_swsVec3","_gwrtVec3a","_gwrtVec3b","_gwrtQuata","_gwrtQuatb","_laVec3","_laQuat","_urfVec3","_urfQuat","_htVec3a","_htVec3b","_gwrQuat","_swrQuat","_quata","_mat4_temp","mat4","_vec3_temp","POSITION_ON","SCALE_ON","ROTATION_ON","SIZE_ON","ANCHOR_ON","COLOR_ON","_cachedPool","Pool","_get","BuiltinGroupIndex","DEBUG","LocalDirtyFlag","POSITION","SCALE","ROTATION","SKEW","TRS","RS","TRSS","PHYSICS_POSITION","PHYSICS_SCALE","PHYSICS_ROTATION","PHYSICS_TRS","PHYSICS_RS","ALL_POSITION","ALL_SCALE","ALL_ROTATION","ALL_TRS","ALL","EventType","TOUCH_START","TOUCH_MOVE","TOUCH_END","TOUCH_CANCEL","MOUSE_DOWN","MOUSE_MOVE","MOUSE_ENTER","MOUSE_LEAVE","MOUSE_UP","MOUSE_WHEEL","POSITION_CHANGED","ROTATION_CHANGED","SCALE_CHANGED","SIZE_CHANGED","ANCHOR_CHANGED","COLOR_CHANGED","CHILD_ADDED","CHILD_REMOVED","CHILD_REORDER","GROUP_CHANGED","SIBLING_ORDER_CHANGED","_touchEvents","_mouseEvents","_skewNeedWarn","_skewWarn","nodePath","NodeUtils","_currentHovered","_touchStartHandler","touch","getLocation","owner","_hitTest","bubbles","dispatchEvent","_touchMoveHandler","_touchEndHandler","_touchCancelHandler","_mouseDownHandler","_mouseMoveHandler","hit","_previousIn","_mouseListener","stopPropagation","_mouseUpHandler","_mouseWheelHandler","_searchComponentsInParent","list","curr","_parent","next","_checkListeners","_objFlags","_bubblingListeners","_capturingListeners","_doDispatchEvent","cachedArray","_getCapturingTargets","eventPhase","currentTarget","_propagationStopped","_propagationImmediateStopped","_getBubblingTargets","_getActualGroupIndex","groupIndex","_updateCullingMask","_cullingMask","_children","updateLocalMatrix3D","_localMatDirty","_matrix","tm","Trs","toMat4","_trs","skx","tan","sky","_worldMatDirty","updateLocalMatrix2D","dirtyFlag","trs","rotation","_eulerAngles","z","hasSkew","rotationRadians","_a","_b","_c","_d","calculWorldMatrix3D","_updateLocalMatrix","parentMat","_worldMatrix","Mat4","copy","calculWorldMatrix2D","_mulMat","mulMat2D","am","bm","outm","aa","ab","ac","ad","atx","aty","ba","bb","bc","bd","btx","bty","mulMat3D","NodeDefines","_opacity","_color","WHITE","_contentSize","Size","_anchorPoint","_position","_scale","_zIndex","Integer","_localZOrder","serializable","_is3DNode","_groupIndex","formerlySerializedAs","group","oldValue","setLocalDirty","_eventMask","_renderFlag","FLAG_WORLD_TRANSFORM","fromAngleZ","rotationX","fromEulerNumber","rotationY","eulerAngles","toEuler","fromEuler","FLAG_TRANSFORM","setRotation","scale","setScale","scaleZ","FLAG_OPACITY_COLOR","range","equals","FLAG_COLOR","anchorX","anchorPoint","anchorY","MAX_ZINDEX","MIN_ZINDEX","_onSiblingIndexChanged","is3DNode","_update3DFunction","up","_up","transformQuat","UP","getWorldRotation","right","_right","RIGHT","forward","_forward","FORWARD","_reorderChildDirty","_widget","_renderComponent","_touchListener","_initDataFromPool","_childArrivalOrder","_LocalDirtyFlag","obj","_delaySort","_onPreDestroy","destroyByParent","_onPreDestroyBase","removeListeners","mask","_backDataIntoPool","sortAllChildren","_onPostActivated","active","_checkListenerMask","_onHierarchyChanged","oldParent","_updateOrderOfArrival","_onHierarchyChangedBase","_nodesOrderDirty","_activeInHierarchy","_calculWorldMatrix","_on3DNodeChanged","_spaceInfo","spaceInfo","localMat","identity","worldMat","_toEuler","_fromEuler","_initProperties","desTrs","subarray","_onBatchCreated","dontSyncChildPrefab","children","child","prefabInfo","_prefab","sync","syncWithPrefab","FLAG_CHILDREN","Mask","_checknSetupSysEvent","newAdded","forDispatch","EventListener","TOUCH_ONE_BY_ONE","swallowTouches","onTouchBegan","onTouchMoved","onTouchEnded","onTouchCancelled","addListener","MOUSE","onMouseDown","onMouseMove","onMouseUp","onMouseScroll","schedule","useCapture","_onDispatch","listeners","__eventTargets","touchEvent","mouseEvent","_offDispatch","removeListener","hasListeners","fastRemove","removeAll","targetOff","has","arg5","_array","put","pauseSystemEvents","recursive","resumeSystemEvents","point","listener","w","h","cameraPt","testPt","camera","findCamera","getScreenToWorldPoint","_updateWorldMatrix","invert","transformMat4","temp","_enabled","runAction","_suppressDeprecation","pauseAllActions","resumeAllActions","stopAllActions","stopAction","stopActionByTag","getNumberOfRunningActions","getPosition","toPosition","newPosOrX","oldPosition","getScale","toScale","newScaleOrX","getRotation","toRotation","getContentSize","setContentSize","locContentSize","approx","getAnchorPoint","setAnchorPoint","locAnchorPoint","_invTransformPoint","ltrs","conjugate","inverseSafe","getWorldPosition","setWorldPosition","fromPosition","setWorldRotation","val","fromRotation","getWorldScale","setWorldScale","div","fromScale","getWorldRT","opos","orot","fromRT","lookAt","fromViewUp","flag","setWorldDirty","getLocalMatrix","getWorldMatrix","worldPoint","nodePoint","convertToNodeSpace","convertToWorldSpace","getNodeToParentTransform","contentSize","transform","fromMat4","getNodeToParentTransformAR","getNodeToWorldTransform","getNodeToWorldTransformAR","getParentToNodeTransform","getWorldToNodeTransform","convertTouchToNodeSpace","convertTouchToNodeSpaceAR","getBoundingBox","getBoundingBoxToWorld","_getBoundingBoxTo","locChildren","childRect","arrivalOrder","setSelfGroupIndex","addChild","cleanup","_setDirtyForNode","_child","child2","count","_restoreProperties","onRestore","_p","vec3_tmp","./event/event","./platform/CCMacro","./platform/js","./renderer/render-flow","./utils/affine-transform","./utils/base-node","./utils/prefab-helper","./utils/trans-pool","./value-types","./value-types/utils","25","_createForOfIteratorHelperLoose","o","allowArrayLike","it","Symbol","_unsupportedIterableToArray","done","TypeError","minLen","_arrayLikeToArray","toString","test","arr2","HideInHierarchy","PrivateNode","_originPos","localPosition","_posDirty","override","showInEditor","editorOnly","sendEvent","_super","setParent","getParent","./CCNode","26","NIL","autoReleaseAssets","_inited","dependAssets","_active","_instantiate","activateNode","27","IdGenerater","MAX_POOL_SIZE","idGenerater","ListEntry","priority","markedForDeletion","_listEntries","HashUpdateEntry","_hashUpdateEntries","HashTimerEntry","timers","timerIndex","currentTimer","currentTimerSalvaged","_t","_hashTimerEntries","CallbackTimer","_lock","_runForever","_useDelay","_timesExecuted","_repeat","_interval","initWithCallback","seconds","REPEAT_FOREVER","getInterval","setInterval","interval","trigger","cancel","getCallback","unschedule","_timers","timer","_timeScale","_updatesNegList","_updates0List","_updatesPosList","_hashForUpdates","_hashForTimers","_currentTargetSalvaged","_updateHashLocked","_arrayForTimers","_removeHashElement","_removeUpdateFromHash","targetId","listEntry","_priorityIn","ppList","listElement","_appendIn","__instanceId","getNewId","setTimeScale","timeScale","getTimeScale","tmp","hashElement","li","unscheduleAllForTarget","unscheduleAllWithMinPriority","minPriority","temp_length","isScheduled","pauseAllTargets","pauseAllTargetsWithMinPriority","idsWithSelectors","locArrayForTimers","elementUpdate","isTargetPaused","PRIORITY_NON_SYSTEM","./platform/id-generater","28","preprocess","fetch","Cache","helper","releaseManager","dependUtil","load","Pipeline","Task","RequestItem","downloader","parser","packManager","Bundle","factory","parse","combine","_require2","parseParameters","asyncify","_require3","assets","files","parsed","pipeline","transformPipeline","fetchPipeline","RequestType","BuiltinBundleName","AssetManager","_preprocessPipe","_fetchPipe","_loadPipe","append","_files","_parsed","generalImportBase","generalNativeBase","cacheAsset","force","cacheManager","presets","preload","maxConcurrency","maxRequestsPerFrame","remote","maxRetryCount","script","MAIN","resources","RESOURCES","INTERNAL","options","bundleVers","server","importBase","nativeBase","getBundle","removeBundle","_destroy","remove","loadAny","requests","onComplete","_parseParameters","preset","task","input","async","preloadAny","_parseParameters2","postLoadNative","asset","_parseParameters3","_native","_nativeAsset","depend","getNativeDep","_uuid","getAssetInfo","message","stack","loadRemote","url","_parseParameters4","__isNative__","ext","path","extname","loadScript","_parseParameters5","__requestType__","URL","loadBundle","nameOrUrl","_parseParameters6","bundleName","basename","releaseAsset","tryRelease","releaseUnusedAssets","forEach","_transform","subTask","urls","item","recycle","e","output","defineProperty","./builtins","./bundle","./cache","./depend-util","./downloader","./factory","./fetch","./helper","./load","./pack-manager","./parser","./pipeline","./preprocess","./releaseManager","./request-item","./shared","./task","./urlTransformer","./utilities","29","_assets","material","effect","_loadBuiltins","dirname","builtin","loadDir","addRef","_loadBuiltinsSP","sp","MAX_MULTITEXTURE_NUM","_loadMultiEffect","multi2dSpriteEffectAsset","inited","multiBatcher","maxAtlasCount","charAtlasAutoBatchCount","EffectAsset","getBuiltin","30","Config","parseLoadResArgs","deps","base","getInfoWithPath","getDirWithPath","_parseLoadResArgs","PATH","__outputAsArray__","_parseLoadResArgs2","dir","_parseLoadResArgs3","DIR","preloadDir","_parseLoadResArgs4","sceneAsset","redirect","./config","31","_map","_count","predicate","../platform/js","32","processOptions","assetInfos","scenes","_initUuid","uuids","_initPath","_initScene","_initPackage","packs","_initVersion","versions","_initRedirect","uuidList","pathList","isSubAsset","assetInfo","_getClassById","sceneList","packageList","packUuid","pack","assetPacks","entries","ver","nativeVer","items","isChildClassOf","infos","isMatchByWord","nextAscii","charCodeAt","startsWith","endsWith","33","_deserializeCompiled","_interopRequireWildcard","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","__esModule","newObj","hasPropertyDescriptor","getOwnPropertyDescriptor","hasOwnProperty","desc","deserialize","_depends","nativeDep","getDeps","getDepsRecursively","exclude","depends","_descend","json","__type__","hasNativeDep","_parseDepsFromJson","_parseDepsFromAsset","parsedFromExistAsset","preventPreloadNativeObject","preventDeferredLoadDependents","__depends__","dep","__nativeDepend__","_nativeDep","getDependUuidList","decodeUuid","../platform/deserialize-compiled","./deserialize","34","utilities","ImageFmts","AudioFmts","GetTrue","md5Pipe","transformURL","getUuidFromURL","hashValue","hashPatchInFolder","replace","match","loader","_autoReleaseSetting","_cache","progressCallback","completeCallback","images","audios","finish","total","content","includes","res","image","audio","isCompleted","getXMLHttpRequest","XMLHttpRequest","getItem","loadRes","_this$_parseLoadResAr","loadResArray","_this$_parseLoadResAr2","loadResDir","_this$_parseLoadResAr3","getRes","getResCount","getDependsRecursively","assetLoader","addDownloadHandlers","extMap","handler","register","addLoadHandlers","file","flowInDeps","isBuiltin","builtinAsset","_isBuiltin","releaseRes","releaseResDir","removeItem","setAutoRelease","autoRelease","setAutoReleaseRecursively","isAutoRelease","loadSubpackage","AssetLibrary","libraryPath","rawAssetsBase","rawAssets","loadAsset","getLibUrlNoExt","queryAssetInfo","raw","changeExtname","substr","onceWarns","assetLibrary","defineProperties","LoadingItems","DOWNLOAD_MAX_CONCURRENT","_getSceneUuid","_sceneInfos","releaseSettings","../CCDirector","35","MissingClass","classFinder","missingClass","_MissingScript","safeFindClass","pool","deserializeForCompiled","deserializeForEditor","Details","tdInfo","customEnv","objList","uuidObjList","propList","uuidPropList","dependUuid","../platform/deserialize","../platform/deserialize-editor","36","__audioSupport","downloadDomAudio","dom","src","clearEvent","removeEventListener","success","failure","USE_LOADER_EVENT","readyState","37","downloadDomImage","img","Image","location","protocol","crossOrigin","loadCallback","errorCallback","38","downloadFile","xhr","errInfo","open","responseType","withCredentials","mimeType","overrideMimeType","timeout","header","setRequestHeader","onload","status","response","onprogress","lengthComputable","loaded","onerror","ontimeout","onabort","send","39","downloaded","downloadScript","loadHandler","removeChild","errorHandler","40","loadFont","_require4","urlAppendTimestamp","retry","REGEX","formatSupport","format","unsupported","downloadAudio","audioLoadMode","AudioClip","LoadMode","DOM_AUDIO","downloadArrayBuffer","WEB_AUDIO","downloadImage","imageBitmap","ALLOW_IMAGE_BITMAP","downloadBlob","onFileProgress","downloadJson","JSON","downloadText","downloadVideo","downloadBundle","version","_downloading","_queue","_queueDirty","_totalNum","_totalNumThisPeriod","_lastDate","_checkNextPeriod","updateTime","Date","_maxInterval","handleQueue","sort","nextOne","invoke","_remoteServerAddress","remoteServerAddress","appendTimeStamp","limited","retryInterval","mixin","downloaders","download","downloadCallbacks","finale","callbacks",".png",".jpg",".bmp",".jpeg",".gif",".ico",".tiff",".webp",".image",".pvr",".pkm",".mp3",".ogg",".wav",".m4a",".txt",".xml",".vsh",".fsh",".atlas",".tmx",".tsx",".json",".ExportJson",".plist",".fnt",".font",".eot",".ttf",".woff",".svg",".ttc",".mp4",".avi",".mov",".mpg",".mpeg",".rm",".rmvb",".binary",".bin",".dbbin",".skel",".js","_downloaders","../CCDebug","../platform/CCSys","../platform/utils","./download-dom-audio","./download-dom-image","./download-file","./download-script.js","./font-loader","41","_creating","createTexture","Texture2D","_nativeUrl","createAudioClip","createVideoClip","VideoClip","createJsonAsset","JsonAsset","createTextAsset","TextAsset","text","createFont","TTFFont","createBufferAsset","BufferAsset","createAsset","createBundle","producers","creating","42","getDepends","firstTask","canInvoke","__exclude__","isNative","handle","__asyncLoadAssets__","isFinish","dispatch","decreaseRef","decRef","loadDepends","43","textUtils","_canvasContext","_testString","_fontFaces","_loadingFonts","_timeout","useNativeCheck","nativeCheck","FontFace","exec","safari10Match","vendor","_checkFontLoaded","allFontsLoaded","fontLoadHandle","fontFamily","fontFamilyName","oldWidth","refWidth","fontDesc","font","newWidth","safeMeasureText","clearInterval","nativeCheckFontLoaded","Promise","resolve","reject","check","fonts","timeoutId","race","fontLoader","_getFontFamily","labelCanvas","getContext","fontStyle","fontStr","textContent","preloadDiv","divStyle","innerHTML","fontHandle","ttfIndex","lastIndexOf","slashPos","substring","../utils/text-utils","44","_uuidRegex","matches","getUrlWithUuid","nativeExt","isScene","../utils/decode-uuid","45","./CCAssetManager","./deprecated","46","gatherAsset","setProperties","checkCircleReference","loadOneAssetPipeline","reload","_exclude$uuid","repeatItem","dependAsset","missingAsset","__onLoadInvoked__","47","_loading","isLoading","unpackJson","unpackJSONs","textureType","_getClassId","datas","split","packCustomObjData","unpackers","unpack","unpacker","48","plistParser","_parsing","parseImage","Blob","imageOptions","imageOrientation","__flipY__","premultiplyAlpha","__premultiplyAlpha__","createImageBitmap","parseAudio","ArrayBuffer","context","decodeAudioData","buffer","parsePVRTex","PVR_HEADER_LENGTH","PVR_MAGIC","PVR_HEADER_MAGIC","PVR_HEADER_FORMAT","PVR_HEADER_HEIGHT","PVR_HEADER_WIDTH","PVR_HEADER_MIPMAPCOUNT","PVR_HEADER_METADATA","Int32Array","dataOffset","pvrtcData","Uint8Array","_compressed","parsePKMTex","ETC_PKM_HEADER_SIZE","ETC_PKM_FORMAT_OFFSET","ETC_PKM_ENCODED_WIDTH_OFFSET","ETC_PKM_ENCODED_HEIGHT_OFFSET","ETC_PKM_WIDTH_OFFSET","ETC_PKM_HEIGHT_OFFSET","ETC1_RGB_NO_MIPMAPS","ETC2_RGB_NO_MIPMAPS","ETC2_RGBA_NO_MIPMAPS","readBEUint16","offset","encodedWidth","encodedHeight","etcData","parsePlist","parseImport","parsers","parsedAsset","parsing","parseHandler","import","../platform/CCSAXParser","49","_pipelineId","funcs","pipes","insert","_isFinish","pipe","_flow","50","subOptions","leftOptions","op","UUID","SCENE","source","51","visitAsset","visitComponent","getOwnPropertyNames","propName","_j","_val","_temp","visitNode","descendOpRef","refs","refCount","checkCircularReference","_persistNodeDeps","_toDelete","eventListener","freeAssets","_free","newScene","persistNodes","childs","dependencies","persistDeps","_asset","sceneDeps","_i3","_l2","../assets/CCAsset","52","MAX_DEAD_NUM","_deadPool","53","START_SCENE","54","_taskId","param1","param2","param3","param4","str","toUpperCase","55","stringify","__nativeName__","56","MissingObjectReporter","realEntries","_entry","packId","packedIds","folder","_uuid2","clearRef","wait","asyncLoadAssets","includeNative","_i4","_dep","_isScene","assetsMap","missingAssetReporter","reportByOwner","errs","isCallback","isValidType","checked","57","CCObject","writable","_ref","nativeUrl","_$nativeAsset","serialize","createNode","_setRawAsset","filename","inLibrary","../platform/CCObject","58","mixins","_audio","loadMode","_loadByUrl","audioClip","_ensureLoaded","uncache","../event/event-target","./CCAsset","59","FontLetterDefinition","offsetX","offsetY","textureID","valid","xAdvance","FontAtlas","texture","_letterDefinitions","_texture","addLetterDefinitions","letter","letterDefinition","cloneLetterDefinition","copyLetterDefinitions","getTexture","getLetter","getLetterDefinitionForChar","_char","hasKey","BitmapFont","Font","fntDataStr","SpriteFrame","fontSize","_fntConfig","_fontDefDictionary","fntConfig","fontDict","fontDefDictionary","fontDef","xOffset","yOffset","60","_buffer","bin","61","62","63","LabelAtlas","64","OptimizationPolicy","AUTO","SINGLE_INSTANCE","MULTI_INSTANCE","Prefab","_createFunction","_instantiatedTimes","optimizationPolicy","readonly","OptimizationPolicyThreshold","compileCreateFunction","jit","compile","_doInstantiate","rootToRedirect","useJit","CC_SUPPORT_JIT","PrefabUtils","../platform/instantiate-jit","65","_gfx","_interopRequireDefault","DepthStencilFormat","RB_FMT_D24S8","RB_FMT_S8","RB_FMT_D16","RenderTexture","_framebuffer","initWithSize","depthStencilFormat","visibleRect","_resetUnderlyingMipmaps","colors","_depthStencilBuffer","depthStencilBuffer","RenderBuffer","depthStencil","FrameBuffer","_packable","updateSize","rbo","_width","drawTextureAt","_image","updateSubImage","level","_premultiplyAlpha","readPixels","gl","oldFBO","getParameter","FRAMEBUFFER_BINDING","bindFramebuffer","FRAMEBUFFER","getHandle","RGBA","UNSIGNED_BYTE","../../renderer/gfx","../renderer","./CCTexture2D","66","67","Script","_Script","JavaScript","_JavaScript","TypeScript","_TypeScript","68","SpriteAtlas","_spriteFrames","getSpriteFrame","sf","getSpriteFrames","69","INSET_LEFT","INSET_TOP","INSET_RIGHT","INSET_BOTTOM","temp_uvs","_textureSetter","_refreshTexture","insetTop","_capInsets","_calculateSlicedUV","insetBottom","insetLeft","insetRight","rotated","originalSize","_rect","uv","_original","_offset","_originalSize","_rotated","_flipX","_flipY","vertices","uvSliced","setTexture","textureLoaded","onTextureLoaded","ensureLoadTexture","isRotated","setRotated","bRotated","_calculateUV","isFlipX","isFlipY","setFlipX","setFlipY","getRect","setRect","getOriginalSize","setOriginalSize","_textureLoadedCallback","_checkRect","setOffset","getOffset","offsets","maxX","maxY","_flipXY","uvs","tempVal","_tempVal","atlasWidth","atlasHeight","leftWidth","rightWidth","centerWidth","topHeight","bottomHeight","centerHeight","row","rowD","col","colD","_row","_rowD","_col","_colD","_setDynamicAtlasFrame","_resetDynamicAtlasFrame","texw","texh","_r","_tempVal2","nu","nv","_serialize","exporting","ctx","_textureFilename","Editor","Utils","UuidCache","urlToUuid","UuidUtils","compressUuid","dependsOn","triangles","atlas","_atlasUuid","capInsets","_deserialize","textureUuid","deleteSpriteFrame","copyWithZone","initWithTexture","70","_fontFamily","String","./CCFont","71","72","GL_NEAREST","GL_LINEAR","GL_REPEAT","GL_CLAMP_TO_EDGE","GL_MIRRORED_REPEAT","GL_RGBA","CHAR_CODE_0","CHAR_CODE_1","CUSTOM_PIXEL_FORMAT","PixelFormat","RGB565","TEXTURE_FMT_R5_G6_B5","RGB5A1","TEXTURE_FMT_R5_G5_B5_A1","RGBA4444","TEXTURE_FMT_R4_G4_B4_A4","RGB888","TEXTURE_FMT_RGB8","RGBA8888","TEXTURE_FMT_RGBA8","RGBA32F","TEXTURE_FMT_RGBA32F","A8","TEXTURE_FMT_A8","I8","TEXTURE_FMT_L8","AI8","TEXTURE_FMT_L8_A8","RGB_PVRTC_2BPPV1","TEXTURE_FMT_RGB_PVRTC_2BPPV1","RGBA_PVRTC_2BPPV1","TEXTURE_FMT_RGBA_PVRTC_2BPPV1","RGB_A_PVRTC_2BPPV1","RGB_PVRTC_4BPPV1","TEXTURE_FMT_RGB_PVRTC_4BPPV1","RGBA_PVRTC_4BPPV1","TEXTURE_FMT_RGBA_PVRTC_4BPPV1","RGB_A_PVRTC_4BPPV1","RGB_ETC1","TEXTURE_FMT_RGB_ETC1","RGBA_ETC1","RGB_ETC2","TEXTURE_FMT_RGB_ETC2","RGBA_ETC2","TEXTURE_FMT_RGBA_ETC2","REPEAT","CLAMP_TO_EDGE","MIRRORED_REPEAT","Filter","LINEAR","NEAREST","FilterIndex","9728","9729","_images","_sharedOpts","minFilter","magFilter","wrapS","wrapT","genMipmaps","_getSharedOptions","initWithData","_format","initWithElement","_minFilter","_magFilter","_mipFilter","_wrapS","_wrapT","_isAlphaAtlas","_genMipmaps","packable","_FilterIndex","extnames","_parseExt","extIdStr","defaultFormat","extIds","defaultExt","bestExt","bestIndex","bestFormat","SupportTextureFormats","SUPPORT_TEXTURE_FORMATS","extFormat","tmpExt","tmpFormat","webp","_hashDirty","_hash","_multiMaterial","getImpl","getId","updateImg","mipFilter","ImageBitmap","_checkImageBitmap","_upload","complete","HTMLCanvasElement","handleLoadedTexture","pixelFormat","pixelsWidth","pixelsHeight","_getGFXPixelFormat","_updateFormat","_checkPackable","getHtmlElementObj","deleteAtlasTexture","unlinkMaterial","getPixelFormat","hasPremultipliedAlpha","isAlphaAtlas","_cleanupImageCache","HTMLImageElement","_clearImage","description","releaseTexture","setWrapMode","setFilters","setPremultiplyAlpha","premultiply","dynamicAtlas","_isCompressed","maxFrameSize","_getHash","Atlas","DEFAULT_HASH","_getOpts","anisotropy","_anisotropy","mipmapSources","extId","exportedExts","_exportedExts","exts","_extId","join","fields","linkMaterial","getMultiHandler","autoSetTexture","removeTexture","getLinkedMaterial","hasLinkedMaterial","../platform/CCClass","../platform/id-generater","73","74","./CCAudioClip","./CCBitmapFont","./CCBufferAsset","./CCJsonAsset","./CCLabelAtlas","./CCPrefab","./CCRenderTexture","./CCSceneAsset","./CCScripts","./CCSpriteAtlas","./CCSpriteFrame","./CCTTFFont","./CCTextAsset","./CCVideoClip","./material","75","_CCAsset","_effectParser","_effect","techniques","shaders","lib","_programLib","define","_initEffect","parseEffect","freeze","getInstantiatedEffect","getEffect","../CCAsset","./effect-parser","76","Texture","textureUtil","gfx","BUILTIN_NAME","SPRITE","GRAY_SPRITE","UNLIT","Material","_manualHash","_dirty","_multiHandler","_defines","_effectAsset","_techniqueIndex","_techniqueData","effectName","effectAsset","updateMultiSupport","techniqueIndex","switchTechnique","getBuiltinMaterial","createWithBuiltin","setProperty","passIdx","directly","def","getDefine","getProperty","setCullMode","cullMode","CULL_BACK","setDepth","depthTest","depthWrite","depthFunc","DS_FUNC_LESS","setBlend","blendEq","blendSrc","blendDst","blendAlphaEq","blendSrcAlpha","blendDstAlpha","blendColor","BLEND_FUNC_ADD","BLEND_SRC_ALPHA","BLEND_ONE_MINUS_SRC_ALPHA","setStencilEnabled","stencilTest","STENCIL_INHERIT","setStencil","stencilFunc","stencilRef","stencilMask","stencilFailOp","stencilZFailOp","stencilZPassOp","stencilWriteMask","DS_FUNC_ALWAYS","STENCIL_OP_KEEP","updateHash","hash","getHash","passDatas","passData","defines","syncTextures","passes","technique","setMultiSupport","isMultiSupport","bool","MultiHandler","../../utils/texture-util","../CCTexture2D","./CCEffectAsset","77","_pass","_enums","_defineProperties","descriptor","enumerable","configurable","_createClass","Constructor","protoProps","staticProps","EffectBase","_technique","_proto","_createPassProp","pass","_properties","uniform","Float32Array","Float64Array","_setPassProperty","compareValue","PARAM_TEXTURE_2D","setStencilFront","setStencilBack","../../../renderer/core/pass","../../../renderer/enums","78","_types","getInvolvedProgram","programName","getTemplate","parseProperties","passJson","propertiesJson","program","uniformInfo","uniforms","_ret","propInfo","PARAM_INT","PARAM_FLOAT","enums2default","passDefines","parseTechniques","techNum","tech","techName","passNum","passName","detailName","stage","newPass","rasterizerState","blendState","blend","depthStencilState","stencilFuncFront","stencilRefFront","stencilMaskFront","stencilFailOpFront","stencilZFailOpFront","stencilZPassOpFront","stencilWriteMaskFront","stencilFuncBack","stencilRefBack","stencilMaskBack","stencilFailOpBack","stencilZFailOpBack","stencilZPassOpBack","stencilWriteMaskBack","../../../renderer/core/technique","../../../renderer/types","./effect","79","_murmurhash2_gc","_effectBase","_inheritsLoose","subClass","superClass","_setPrototypeOf","setPrototypeOf","__proto__","EffectVariant","_EffectBase","_passes","_stagePasses","_onEffectChanged","variantPasses","stagePasses","variant","_stage","serializePasses","../../../renderer/murmurhash2_gc","./effect-base","./utils","80","Effect","_techniques","createNative","81","./CCMaterial","./material-variant","82","_pool","MaterialPool","_Pool","_len","_key","exampleMat","renderComponent","MaterialVariant","_owner","instance","serializeDefines","serializeTechniques","mat","maxSize","_clean","materialPool","../../utils/pool","83","_CCMaterial","_effectVariant","_materialPool","_dec","_class","ccclass","_decorator","_Material","materialName","_material","./effect-variant","./material-pool","84","hashArray","names","serializePass","excludeProperties","_programName","_cullMode","_blend","_blendEq","_blendAlphaEq","_blendSrc","_blendDst","_blendSrcAlpha","_blendDstAlpha","_blendColor","_depthTest","_depthWrite","_depthFunc","_stencilTest","_stencilFuncFront","_stencilRefFront","_stencilMaskFront","_stencilFailOpFront","_stencilZFailOpFront","_stencilZPassOpFront","_stencilWriteMaskFront","_stencilFuncBack","_stencilRefBack","_stencilMaskBack","_stencilFailOpBack","_stencilZFailOpBack","_stencilZPassOpBack","_stencilWriteMaskBack","serializeUniforms","_propertyNames","_defineNames","hashData","param","PARAM_TEXTURE_CUBE","85","TOP","MID","BOT","LEFT","CENTER","HORIZONTAL","VERTICAL","AlignMode","ONCE","ON_WINDOW_RESIZE","ALWAYS","getReadonlyNodeSize","computeInverseTransForTarget","widgetNode","out_inverseTranslate","out_inverseScale","translateX","translateY","tInverseTranslate","tInverseScale","ONE","align","widget","hasTarget","inverseTranslate","inverseScale","targetSize","targetAnchor","isRoot","anchor","_alignFlags","localLeft","localRight","targetWidth","_isAbsLeft","_left","_isAbsRight","isStretchWidth","isAlignHorizontalCenter","localHorizontalCenter","_isAbsHorizontalCenter","_horizontalCenter","targetCenter","isAlignLeft","localTop","localBottom","targetHeight","bottom","_isAbsBottom","_bottom","_isAbsTop","_top","isStretchHeight","isAlignVerticalCenter","localVerticalCenter","_isAbsVerticalCenter","_verticalCenter","targetMiddle","isAlignBottom","alignMode","widgetManager","activeWidgets","animationState","refreshScene","AnimUtils","EditMode","nowPreviewing","_component","_animation","isAligning","_activeWidgetsIterator","editingNode","adjustWidgetToAllowMovingInEditor","adjustWidgetToAllowResizingInEditor","updateAlignment","Widget","_AlignFlags","thisOnResized","onResized","refreshWidgetOnResized","../CCNode","86","_geomUtils","RendererCamera","_mat4_temp_1","_mat4_temp_2","_v3_temp_1","_v3_temp_2","_v3_temp_3","_cameras","updateMainCamera","minDepth","_depth","_debugCamera","repositionDebugCamera","getNode","ClearFlags","COLOR","DEPTH","STENCIL","StageFlags","OPAQUE","TRANSPARENT","Component","setStages","dirty","_camera","editor","_clearFlags","_backgroundColor","_zoomRatio","_targetTexture","_fov","_orthoSize","_nearClip","_farClip","_ortho","_renderStages","_alignWithScreen","zoomRatio","tooltip","fov","orthoSize","nearClip","_updateClippingpPlanes","farClip","ortho","_updateProjection","_updateRect","cullingMask","_updateCameraMask","clearFlags","setClearFlags","_updateBackgroundColor","setPriority","targetTexture","_updateTargetTexture","renderStages","_updateStages","alignWithScreen","_is3D","cameras","containsNode","_findRendererCamera","_setupDebugCamera","setFov","setNear","setFar","setColor","setNode","addCamera","setFrameBuffer","setType","flags","stages","_init","beforeDraw","__preload","onEnable","onDisable","removeCamera","getScreenToWorldMatrix2D","getWorldToScreenMatrix2D","_mat4_temp_1m","m12","m13","center","screenPosition","screenToWorld","getWorldToScreenPoint","worldPosition","worldToScreen","getRay","screenPos","geomUtils","Ray","fromPoints","rootNode","renderCamera","_onAlignWithScreen","RAD","atan","setOrthoHeight","getNodeToCameraTransform","getWorldToCameraMatrix","getCameraToWorldPoint","getWorldToCameraPoint","getCameraToWorldMatrix","../../renderer/scene/camera","../CCGame","../geom-utils","../renderer/index","../renderer/render-flow","../utils/affine-transform","../value-types","87","jsArray","IsStartCalled","IsOnEnableCalled","IsEditorOnEnableCalled","callerFunctor","callOnEnableInTryCatch","callOnDisableInTryCatch","sortedIndex","order","_executionOrder","testOrder","testId","stableRemoveInactive","flagToClear","removeAt","LifeCycleInvoker","__ctor__","invokeFunc","Iterator","_zero","_neg","_pos","_invoke","compareOrder","OneOffInvoker","cancelInactive","compsNeg","compsPos","ReusableInvoker","enableInEditor","engine","createInvokeImpl","indiePath","useDt","ensureFlag","fastPath","Function","invokeStart","invokeUpdate","invokeLateUpdate","startInvoker","updateInvoker","lateUpdateInvoker","_deferredComps","_updating","invokeOnEnable","compScheduler","deactivatedDuringOnEnable","_onEnabled","_scheduleImmediate","_onDisabled","lateUpdate","enableComp","invoker","disableComp","_deferredSchedule","_startForNewComps","./platform/CCClass","./utils/misc","88","equalClips","clip1","clip2","PLAY","STOP","PAUSE","RESUME","LASTFRAME","FINISHED","Animation","_animator","_nameToState","_didInit","_currentClip","_defaultClip","defaultClip","contain","currentClip","_writableClips","_clips","playOnLoad","isPlaying","getAnimationState","onDestroy","getClips","playAdditive","enabledInHierarchy","setCurrentTime","hasAnimationState","addClip","newName","contains","oldState","newState","removeClip","filter","_EventTargetOn","states","_EventTargetOff","_createStates","defaultClipState","../../animation/animation-animator","../../animation/animation-clip","./CCComponent","89","BlockEvents","BlockInputEvents","menu","inspector","help","90","GraySpriteState","Transition","State","NORMAL","HOVER","PRESSED","DISABLED","Button","_pressed","_hovered","_fromColor","_toColor","_time","_transitionFinished","_fromScale","_toScale","_originalScale","_graySpriteMaterial","_spriteMaterial","_sprite","interactable","notify","_updateState","_resetState","animatable","_resizeToTarget","_resizeNodeToTargetNode","enableAutoGrayEffect","_updateDisabledState","transition","_updateTransition","normalColor","displayName","_getButtonState","_getTarget","pressedColor","hoverColor","disabledColor","zoomScale","normalSprite","pressedSprite","hoverSprite","disabledSprite","_applyTarget","_unregisterTargetEvent","clickEvents","EventHandler","originalScale","_setTargetColor","_registerNodeEvent","_unregisterNodeEvent","_onTargetSpriteFrameChanged","_setCurrentStateSprite","_onTargetColorChanged","_setCurrentStateColor","_onTargetScaleChanged","cloneColor","_getStateColor","_getStateSprite","_onTouchBegan","_onTouchMove","_onTouchEnded","_onTouchCancel","_onMouseMoveIn","_onMouseMoveOut","_registerTargetEvent","_getTargetSprite","sprite","Sprite","_applyTransition","emitEvents","_updateColorTransitionImmediately","_updateColorTransition","_updateSpriteTransition","_updateScaleTransition","_zoomUp","_zoomBack","oldTransition","useGrayMaterial","_switchGrayMaterial","../utils/gray-sprite-state","91","resetWidgetComponent","addComponent","isAlignTop","isAlignRight","Canvas","resetInEditor","_designResolution","designResolution","applySettings","_fitWidth","_fitHeight","fitHeight","fitWidth","_fitDesignResolution","cameraNode","setSiblingIndex","ResolutionPolicy","policy","SHOW_ALL","FIXED_WIDTH","FIXED_HEIGHT","NO_BORDER","designRes","setDesignResolutionSize","../camera/CCCamera","92","IsOnLoadCalled","getClassName","trimLeft","__scriptAsset","_this$node","_this$node2","_this$node2$_parent","_isOnLoadCalled","onFocusInEditor","onLostFocusInEditor","typeOrClassName","getComponents","getComponentInChildren","_getLocalBounds","unscheduleAllCallbacks","eventTargets","destroyComp","_removeComponent","cloned","instantiate","_clone","scheduleOnce","callback_fn","_requireComponent","cls","reqComp","requireComponent","executionOrder","_disallowMultiple","willExecuteInEditMode","__scriptUuid","93","_componentId","_componentName","_genCompIdIfNeeded","_compId2Name","_compName2Id","customEventData","compType","getClassByName","compId","94","LabelFrame","BlendFunc","deleteFromDynamicAtlas","HorizontalAlign","TextAlignment","VerticalAlign","VerticalTextAlignment","Overflow","CLAMP","SHRINK","RESIZE_HEIGHT","CacheMode","BITMAP","CHAR","BOLD_FLAG","ITALIC_FLAG","UNDERLINE_FLAG","Label","_actualFontSize","_assemblerData","_frame","_ttfTexture","_letterTexture","_updateMaterial","_updateMaterialCanvas","_updateMaterialWebgl","_string","string","setVertsDirty","_checkStringEmpty","multiline","horizontalAlign","verticalAlign","actualFontSize","_fontSize","_lineHeight","lineHeight","overflow","_enableWrapText","enableWrapText","_N$file","_isSystemFontUsed","_forceUpdateRenderData","useSystemFont","markForValidate","_bmFontOriginalSize","_spacingX","spacingX","_batchAsBitmap","cacheMode","_materials","_shareAtlas","setMaterial","_getDefaultMaterial","_styleFlags","enableBold","enableItalic","enableUnderline","_underlineHeight","underlineHeight","autoSwitchMaterial","EnableType","GLOBAL","allowDynamicAtlas","enableRetina","clearCharCache","clearAllCache","_nodeSizeChanged","_nodeColorChanged","_assembler","_resetAssemblerData","_resetFrame","_updateColor","_srcBlendFactor","BlendFactor","SRC_ALPHA","FLAG_OPACITY","_validateRender","disableRender","_resetAssembler","markForRender","_applyFontTexture","_onBMFontTextureLoaded","updateRenderData","_onBlendChanged","_nativeTTF","_getAssemblerData","getMaterial","_updateTTFMaterial","isMultiMaterial","_texIdDirty","isMulti","_forceUseCanvas","_useNativeTTF","ENABLE_NATIVE_TTF_RENDERER","_enableBold","_enableItalics","_enableUnderline","../assets/material/CCMaterial","../platform/CCMacro","../renderer/utils/label/label-frame","../renderer/utils/utils","../utils/blend-func","./CCRenderComponent","95","LabelOutline","_updateRenderData","label","96","LabelShadow","_blur","blur","97","NodeEvent","Type","GRID","ResizeMode","CONTAINER","CHILDREN","AxisDirection","VerticalDirection","BOTTOM_TO_TOP","TOP_TO_BOTTOM","HorizontalDirection","LEFT_TO_RIGHT","RIGHT_TO_LEFT","Layout","_layoutSize","_layoutDirty","_resize","_N$layoutType","reLayouted","_doLayoutDirty","resizeMode","cellSize","startAxis","paddingLeft","paddingRight","paddingTop","paddingBottom","spacingY","verticalDirection","horizontalDirection","affectedByScale","_addEventListeners","_removeEventListeners","_doScaleDirty","updateLayout","_resized","_childAdded","_childRemoved","_addChildrenEventListeners","_removeChildrenEventListeners","_doLayoutHorizontally","baseWidth","rowBreak","fnPositionY","applyChildren","layoutAnchor","sign","paddingX","leftBoundaryOfLayout","nextX","rowMaxHeight","tempMaxHeight","secondMaxHeight","containerResizeBoundary","maxHeightChildAnchorY","activeChildCount","newChildWidth","childScaleX","_getUsedScaleValue","childScaleY","childBoundingBoxWidth","childBoundingBoxHeight","rightBoundaryOfChild","rowBreakBoundary","leftToRightRowBreak","rightToLeftRowBreak","finalPositionY","signX","tempFinalPositionY","topMarign","_getVerticalBaseHeight","newHeight","_doLayoutVertically","baseHeight","columnBreak","fnPositionX","paddingY","bottomBoundaryOfLayout","nextY","columnMaxWidth","tempMaxWidth","secondMaxWidth","column","maxWidthChildAnchorX","newChildHeight","topBoundaryOfChild","columnBreakBoundary","bottomToTopColumnBreak","topToBottomColumnBreak","finalPositionX","tempFinalPositionX","rightMarign","_doLayoutBasic","allChildrenBoundingBox","leftBottomSpace","rightTopSpace","xMax","yMax","newSize","toFixed","newAnchorX","newAnchorY","_doLayoutGridAxisHorizontal","layoutSize","topOffset","boundary","_doLayoutGridAxisVertical","leftOffset","_doLayoutGrid","_getHorizontalBaseWidth","_doLayout","activeChild","98","_mat","_vec","_materialVariant","Graphics","_vec2_temp","_circlepoints","_calculateCircle","radius","segements","anglePerStep","MaskType","RECT","ELLIPSE","IMAGE_STENCIL","SEGEMENTS_MIN","SEGEMENTS_MAX","_graphics","_enableMaterial","_exitMaterial","_clearMaterial","_spriteFrame","_type","alphaThreshold","_updateGraphics","_activateMaterial","lastSprite","slide","inverted","Boolean","_segments","FLAG_POST_RENDER","_removeGraphics","_createGraphics","STENCIL_DISABLE","Assembler","lineWidth","strokeColor","graphics","lineTo","stroke","fill","rx","ry","px","py","enable","FLAG_RENDER","FLAG_UPDATE_RENDER_DATA","../assets/material/material-variant","../graphics/graphics","../utils/misc","../value-types/mat4","../value-types/vec2","99","MotionStreak","_lastWPos","preview","_fadeTime","fadeTime","_minSeg","minSeg","_stroke","_checkSwitchMaterial","_fastMode","fastMode","checkAndSwitchMaterial","_updateMultiTexId","textureImpl","updateTexId","_renderData","../../core/utils/blend-func","../components/CCRenderComponent","100","_temp_color","ENABLE","DISABLE","materials","_vertsDirty","_texId","assembler","registerValidate","instantiated","getMaterials","updateColor","srcBlendFactor","_checkBacth","_flush","_dummyNode","multi","spTexture","nSpTexture","same","isChanged","texId","getIndex","../renderer/assembler","101","HtmlTextParser","_htmlTextParser","RichTextChildName","RichTextChildImageName","debounce","immediate","later","callNow","outline","richtext","labelNode","DontSave","labelComponent","RichText","_textArray","_labelSegments","_labelSegmentsCache","_linesWidth","_updateRichTextStatus","_updateRichText","_onTTFLoaded","maxWidth","imageAtlas","handleTouchEvent","customMaterial","spriteComponent","_labelComponent","_labelComponent2","_labelComponent3","_labelComponent4","_activateChildren","_onColorChanged","parentColor","childNode","_updateLabelSegmentTextAttributes","_applyTextAttribute","_createFontLabel","_measureText","styleIndex","_styleIndex","labelSize","labelSegment","clickHandler","_clickHandler","clickParam","_clickParam","_containsTouchLocation","myRect","_lineOffsetX","_lineCount","_labelWidth","_labelHeight","_addLabelSegment","stringToken","_updateRichTextWithMaxWidth","labelString","labelWidth","fragmentWidth","checkStartIndex","checkEndIndex","_getFirstWordLen","checkString","checkStringWidth","remainingString","_updateLineInfo","fragments","fragmentText","splitString","_isLastComponentCR","_needsUpdateTextLayout","newTextArray","oldItem","newItem","oldStyle","newStyle","italic","isImage","imageAlign","imageHeight","imageWidth","imageOffset","_addRichTextImageElement","richTextElement","spriteFrameName","spriteNode","_imageOffset","SLICED","sizeMode","SizeMode","CUSTOM","spriteRect","scaleFactor","spriteWidth","spriteHeight","expectWidth","expectHeight","click","lastEmptyLine","newline","multilineTexts","BASELINE_RATIO","_updateRichTextPosition","startIndex","textLen","character","charAt","isUnicodeCJK","isUnicodeSpace","nextTokenX","nextLineIndex","totalLineCount","lineCount","lineOffsetX","lineHeightSet","lineHeightReal","isInteger","_offsetY","_convertLiteralColorValue","colorValue","fromHEX","textStyle","isAsset","bold","enableItalics","underline","labelOutlineComponent","../utils/html-text-parser","102","GETTINGSHORTERFACTOR","Direction","Scrollbar","_scrollView","_touching","_autoHideRemainingTime","_onScroll","enableAutoHide","autoHideTime","setTargetScrollView","scrollView","_convertToScrollViewSpace","scrollViewNode","worldSpacePos","scrollViewSpacePos","_setOpacity","outOfBoundary","scrollViewSize","handleNodeSize","_conditionalDisableScrollBar","contentMeasure","scrollViewMeasure","outOfBoundaryValue","contentPosition","handleNodeMeasure","_calculateLength","_calculatePosition","_updateLength","_updateHanlderPosition","_fixupHandlerPosition","barSize","barAnchor","handleSize","handleParent","leftBottomWorldPosition","fixupPosition","denominatorValue","lengthRation","actualLenth","positionRatio","clamp01","handleNode","_processAutoHide","deltaTime","103","NUMBER_OF_GATHERED_TOUCHES_FOR_MOVE_SPEED","OUT_OF_BOUNDARY_BREAKING_FACTOR","MOVEMENT_FACTOR","_tempPoint","_tempPrevPoint","quintEaseOut","getTimeInMilliseconds","currentTime","getMilliseconds","SCROLL_TO_TOP","SCROLL_TO_BOTTOM","SCROLL_TO_LEFT","SCROLL_TO_RIGHT","SCROLLING","BOUNCE_TOP","BOUNCE_BOTTOM","BOUNCE_LEFT","BOUNCE_RIGHT","SCROLL_ENDED","TOUCH_UP","AUTOSCROLL_ENDED_WITH_THRESHOLD","SCROLL_BEGAN","eventMap","scroll-to-top","scroll-to-bottom","scroll-to-left","scroll-to-right","scrolling","bounce-bottom","bounce-left","bounce-right","bounce-top","scroll-ended","touch-up","scroll-ended-with-threshold","scroll-began","ScrollView","_topBoundary","_bottomBoundary","_leftBoundary","_rightBoundary","_touchMoveDisplacements","_touchMoveTimeDeltas","_touchMovePreviousTimestamp","_touchMoved","_autoScrolling","_autoScrollAttenuate","_autoScrollStartPosition","_autoScrollTargetDelta","_autoScrollTotalTime","_autoScrollAccumulatedTime","_autoScrollCurrentlyOutOfBoundary","_autoScrollBraking","_autoScrollBrakingStartPosition","_outOfBoundaryAmount","_outOfBoundaryAmountDirty","_stopMouseWheel","_mouseWheelEventElapsedTime","_isScrollEndedWithThresholdEventFired","_scrollEventEmitMask","_isBouncing","_scrolling","_calculateBoundary","horizontal","vertical","inertia","brake","elastic","bounceDuration","horizontalScrollBar","_updateScrollBar","verticalScrollBar","scrollEvents","cancelInnerEvents","_view","scrollToBottom","timeInSecond","attenuated","moveDelta","_calculateMovePercentDelta","applyToHorizontal","applyToVertical","_startAutoScroll","_moveContent","scrollToTop","scrollToLeft","scrollToRight","scrollToTopLeft","scrollToTopRight","scrollToBottomLeft","scrollToBottomRight","scrollToOffset","maxScrollOffset","getMaxScrollOffset","scrollTo","getScrollOffset","topDelta","_getContentTopBoundary","leftDeta","_getContentLeftBoundary","viewSize","horizontalMaximizeOffset","verticalMaximizeOffset","scrollToPercentHorizontal","scrollToPercentVertical","stopAutoScroll","setContentPosition","fuzzyEquals","getContentPosition","isScrolling","isAutoScrolling","_registerEvent","_onTouchMoved","_onTouchCancelled","_onMouseWheel","_unregisterEvent","captureListeners","hasNestedViewGroup","deltaMove","wheelPrecision","os","OS_WINDOWS","browserType","BROWSER_TYPE_FIREFOX","getScrollY","_processDeltaMove","_handlePressLogic","_checkMouseWheel","_stopPropagationIfTargetIsMe","currentOutOfBoundary","_getHowMuchOutOfBoundary","maxElapsedTime","_processInertiaScroll","_dispatchEvent","_onScrollBarTouchEnded","scrollSize","bottomDeta","_getContentBottomBoundary","totalScrollDelta","_moveContentToTopLeft","_updateScrollBarState","_adjustContentOutOfBoundary","layout","CAPTURING_PHASE","ViewGroup","AT_TARGET","_handleMoveLogic","getStartLocation","cancelEvent","EventTouch","getTouches","simulate","_handleReleaseLogic","_scrollChildren","_gatherTouchMove","_getLocalAxisAlignDelta","getPreviousLocation","_clampDelta","realMove","vertical_scrollEventType","horizontal_scrollEventType","icBottomPos","icTopPos","icRightPos","icLeftPos","_onScrollBarTouchBegan","shift","timeStamp","_startBounceBackIfNeeded","bounceBackAmount","bounceBackTime","bounceBackStarted","touchMoveVelocity","_calculateTouchMoveVelocity","_startInertiaScroll","_isOutOfBoundary","_isNecessaryAutoScrollBrake","getScrollEndedEventTiming","_processAutoScrolling","isAutoScrollBrake","brakingFactor","percentage","newPosition","reachedEnd","fireEvent","brakeOffsetPosition","inertiaTotalMovement","_startAttenuatingAutoScroll","_calculateAttenuatedFactor","initialVelocity","_calculateAutoScrollTimeByInitalSpeed","targetDelta","scrollviewSize","totalMoveWidth","totalMoveHeight","attenuatedFactorX","attenuatedFactorY","originalMoveLength","factor","initalSpeed","adjustedDeltaMove","_flattenVectorByDirection","totalTime","reduce","totalMovement","canStartBounceBack","adjustedMove","contentPos","_getContentRightBoundary","addition","outOfBoundaryAmount","_hideScrollbar","./CCViewGroup","104","Horizontal","Vertical","Slider","_touchHandle","_dragging","_updateHandlePosition","slideEvents","_onHandleDragStart","_handleSliderLogic","_updateProgress","_emitSlideEvent","localTouchPos","handlelocalPos","105","SpriteType","SIMPLE","TILED","FILLED","MESH","FillType","RADIAL","TRIMMED","RAW","GRAY","_sizeMode","_fillType","_fillCenter","_fillStart","_fillRange","_isTrimmedMode","_atlas","_applySpriteFrame","fillType","fillCenter","fillStart","fillRange","trim","_applySpriteSize","setVisible","setState","getState","oldDefine","_applyAtlas","oldFrame","oldTexture","frameValid","newTexture","106","Toggle","_N$isChecked","isChecked","toggleGroup","_toggleContainer","allowSwitchOff","_updateCheckMark","updateToggles","_triggerEventInScript_isChecked","_emitToggleEvents","checkMark","checkEvents","_triggerEventInScript_check","_registerToggleEvent","addToggle","_unregisterToggleEvent","removeToggle","_hideCheckMark","toggle","uncheck","ToggleContainer","./CCButton","./CCToggleGroup","107","toggleItems","_allowOnlyOneToggleChecked","_makeAtLeastOneToggleChecked","108","ToggleGroup","_toggleItems","showed","109","110","WidgetManager","AlignFlags","TOP_BOT","LEFT_RIGHT","_setAlign","horizontalCenter","verticalCenter","isAbsoluteHorizontalCenter","isAbsoluteVerticalCenter","isAbsoluteTop","isAbsoluteBottom","isAbsoluteLeft","isAbsoluteRight","_wasAlignOnce","_originalWidth","_originalHeight","_validateTargetInDEV","isAlign","isHorizontal","../base-ui/CCWidgetManager","111","SubContextView","WXSubContextView","SwanSubContextView","./CCAnimation","./CCAudioSource","./CCBlockInputEvents","./CCCanvas","./CCComponentEventHandler","./CCLabel","./CCLabelOutline","./CCLabelShadow","./CCLayout","./CCMask","./CCMotionStreak","./CCPageView","./CCPageViewIndicator","./CCProgressBar","./CCRichText","./CCSafeArea","./CCScrollBar","./CCScrollView","./CCSlider","./CCSprite","./CCToggle","./CCToggleContainer","./CCWidget","./SubContextView","./editbox/CCEditBox","./missing-script","112","MissingScript","compiled","_$erialized","reportMissingClass","113","EventMouse","eventType","_eventType","_button","_prevX","_prevY","_scrollX","_scrollY","setScrollData","scrollX","scrollY","getScrollX","setLocation","getLocationInView","_designResolutionSize","_setPrevCursor","getDelta","getDeltaX","getDeltaY","setButton","button","getButton","getLocationX","getLocationY","DOWN","MOVE","SCROLL","BUTTON_LEFT","BUTTON_RIGHT","BUTTON_MIDDLE","BUTTON_4","BUTTON_5","BUTTON_6","BUTTON_7","BUTTON_8","touchArr","TOUCH","_eventCode","_touches","currentTouch","getEventCode","_setEventCode","eventCode","_setTouches","touches","setTouchInfo","getID","MAX_TOUCHES","BEGAN","MOVED","ENDED","CANCELED","EventAcceleration","acc","ACCELERATION","EventKeyboard","keyCode","isPressed","KEYBOARD","../event/event","114","listenerID","_onEvent","_listenerID","_registered","_fixedPriority","_node","_isEnabled","_setPaused","_setRegistered","registered","_isRegistered","_getType","_getListenerID","_setFixedPriority","fixedPriority","_getFixedPriority","_setSceneGraphPriority","_getSceneGraphPriority","checkAvailable","isEnabled","UNKNOWN","TOUCH_ALL_AT_ONCE","ListenerID","Custom","listenerId","_onCustomEvent","Mouse","TouchOneByOne","_claimedTouches","setSwallowTouches","needSwallow","isSwallowTouches","TouchAllAtOnce","onTouchesBegan","onTouchesMoved","onTouchesEnded","onTouchesCancelled","Acceleration","_onAccelerationEvent","Keyboard","onKeyPressed","onKeyReleased","argObj","listenerType","eventName","115","_EventListenerVector","_fixedListeners","_sceneGraphListeners","gt0Index","empty","clearSceneGraphListeners","clearFixedListeners","getFixedPriorityListeners","getSceneGraphPriorityListeners","__getListenerID","DIRTY_NONE","DIRTY_FIXED_PRIORITY","DIRTY_SCENE_GRAPH_PRIORITY","DIRTY_ALL","_listenersMap","_priorityDirtyFlagMap","_nodeListenersMap","_toAddedListeners","_toRemovedListeners","_dirtyListeners","_inDispatch","_currentTouch","_currentTouchListener","_internalCustomListenerIDs","selListeners","selListener","childrenCount","_BaseNode","_clearCurTouch","_addListener","_forceAddEventListener","_setDirty","_associateNodeAndEventListener","_getListeners","_updateDirtyFlagForSceneGraph","locDirtyListeners","selKey","_removeAllListenersInVector","listenerVector","_dissociateNodeAndEventListener","_removeListenersForListenerID","fixedPriorityListeners","sceneGraphPriorityListeners","locToAddedListeners","_sortEventListeners","locFlagMap","_sortListenersOfFixedPriority","rootEntity","_sortListenersOfSceneGraphPriority","sceneGraphListener","_sortEventListenersOfSceneGraphPriorityDes","l1","node1","node2","ex","fixedListeners","_sortListenersOfFixedPriorityAsc","_onUpdateListeners","idx","toRemovedListeners","locListenersMap","locPriorityDirtyFlagMap","_cleanToRemovedListeners","_updateTouchListeners","locInDispatch","_onTouchEventCallback","argsObj","selTouch","isClaimed","removedIdx","getCode","ENABLE_MULTI_TOUCH","isStopped","needsMutableSet","_dispatchTouchEvent","oneByOneListeners","allAtOnceListeners","originalTouches","mutableTouches","oneByOneArgsObj","_dispatchEventToListeners","_onTouchesEventCallback","callbackParams","onEvent","eventOrArgs","shouldStopPropagation","locDirtyFlagMap","_sortNumberAsc","nodeOrPriority","addCustomListener","isFound","locListener","_removeListenerInVector","_removeListenerInCallback","listenersCopy","removeCustomListeners","customEventName","removeAllListeners","locListeners","locInternalCustomEventIDs","getType","_onListenerCallback","dispatchCustomEvent","optionalUserData","ev","EventCustom","setUserData","./CCEventListener","116","Touch","_lastModified","_point","_prevPoint","_startPoint","getPreviousLocationInView","getStartLocationInView","_startPointCaptured","_convertPointWithScale","_setPoint","_setPrevPoint","117","./CCEvent","./CCEventManager","./CCTouch","118","CallbacksInvoker","EventListeners","_callbackTable","rootInvoker","isInvoking","callbackInfos","containCanceled","purgeCanceled","../platform/callbacks-invoker","119","__on","__off","120","unuse","NO_TYPE","reuse","stopPropagationImmediate","getCurrentTarget","BUBBLING_PHASE","detail","getUserData","getEventName","_eventPool","121","./event","./event-listeners","./event-target","./system-event","122","inputManger","KEY_DOWN","KEY_UP","DEVICEMOTION","keyboardListener","accelerationListener","SystemEvent","setAccelerometerEnabled","isEnable","DeviceMotionEvent","requestPermission","setAccelerometerInterval","systemEvent","hasKeyDownEventListener","hasKeyUpEventListener","../event-manager","../platform/CCInputManager","123","LineCap","LineJoin","_impl","_Impl","_lineWidth","_strokeColor","BLACK","_lineJoin","MITER","_lineCap","BUTT","_fillColor","_miterLimit","lineJoin","lineCap","fillColor","miterLimit","glExtension","bezierCurveTo","c2x","c2y","quadraticCurveTo","cx","cy","arc","endAngle","counterclockwise","ellipse","circle","roundRect","fillRect","clean","Helper","124","PointFlags","KAPPA90","da","hda","kappa","dx","dy","tanx","tany","ptanx","ptany","ndivs","tesselateBezier","y3","x4","y4","x12","y12","x23","y23","x34","y34","x123","y123","x234","y234","x1234","y1234","d3","_tessTol","_addPoint","PT_BEVEL","125","./graphics","126","ROUND","SQUARE","BEVEL","PT_CORNER","PT_LEFT","PT_INNERBEVEL","127","./3d","./CCPrivateNode","./CCScene","./assets","./base-ui/CCWidgetManager","./camera/CCCamera","./collider","./collider/CCIntersection","./components","./geom-utils","./mesh","./physics","./platform","./sp","128","CompScheduler","IsPreloadStarted","IsOnLoadStarted","Deactivating","callPreloadInTryCatch","callOnLoadInTryCatch","callOnDestroyInTryCatch","callOnFocusInTryCatch","callOnLostFocusInTryCatch","UnsortedInvoker","invokePreload","invokeOnLoad","activateTasksPool","getActivateTask","_componentCorrupted","_onLoadInEditor","focused","Selection","curActivate","_Scene","AssetsWatcher","_activatingStack","_activateNodeRecursively","preloadInvoker","onLoadInvoker","onEnableInvoker","originCount","activateComp","_deactivateNodeRecursively","lastTask","deactivatedOnLoading","resetComp","129","_isPlainEmptyObj_DEV","isPlainEmptyObj_DEV","_cloneable_DEV","cloneable_DEV","Attr","DELIMETER","BUILTIN_ENTRIES","INVALID_STATICS_DEV","pushUnique","deferredInitializer","declareProperties","$super","appendProp","__props__","defineProp","es6","defaultValue","setClassAttr","parseAttributes","defineGetSet","getter","setter","setterUndefined","getDefault","defaultVal","mixinWithInherited","dest","getPropertyDescriptor","doDefine","baseClass","shouldAddProtoCtor","__es6__","__ES6__","ctorToUse","ctors","fireClass","_getAllCtors","_createCtor","CCClass","_isCCClass","getClassAttrs","__initProps__","compileProps","setClassName","_RF","peek","_setClassId","normalizeClassName_DEV","DefaultName","getNewValueTypeCodeJit","clsName","propVal","escapeForJS","getInitPropsJit","attrs","F","attrKey","statement","IDENTIFIER_RE","expression","ValueType","initProps","getInitProps","simpleEnd","valueTypeEnd","simples","valueTypes","advanceds","totalLength","actualClass","superCallBounded","boundSuperCalls","ctorName","ctorLen","useTryCatch","SNIPPET","_validateCtor_DEV","originCtor","getCtors","__ctors__","baseOrMixins","baseOrMixin","baseCtors","SuperCallReg","xyz","SuperCallRegStrict","hasSuperCall","superFunc","preprocessAttrs","__values__","_sealed","some","staticPropName","validateMethodWithProps","_registerEditorProps","_fastDefine","serializableFields","attr","getInheritanceChain","klass","chain","getSuper","PrimitiveTypes","onAfterProps_ET","attributes","usedInGetter","ERR_Type","propNamePrefix","initAttrs","primitiveType","_short","getTypeChecker_ET","ScriptUuid","ScriptAsset","isEnum","getList","getObjTypeChecker_ET","parseSimpleAttr","attrName","expectType","startsWithUS","fastDefine","getNewValueTypeCode","./CCEnum","./attribute","./js","./preprocess-class","./requiring-frame","130","Preprocess","CACHE_KEY","fNOP","getSubDict","checkCtorArgument","decorate","_checkNormalArgument","validator_DEV","decoratorName","checkCompArgument","_argumentChecker","checkStringArgument","checkNumberArgument","getClassCache","getDefaultFromInitializer","initializer","extractActualDefaultValues","dummyObj","genProperty","fullOptions","isGetset","getFullFormOfProperty","existsProperty","errorProps","isDefaultValueSpecified","actualDefaultValues","decoratedProto","propNames","property","ctorProtoOrOptions","normalized","ctorProto","ccclassProto","createEditorDecorator","argCheckFunc","editorPropName","staticValue","decoratedValue","createDummyDecorator","executeInEditMode","disallowMultiple","playOnFocus","icon","./CCClass","131","reverseKey","enumType","enumDef","__enums__","enums","_TestEnum","132","PORTRAIT","LANDSCAPE_LEFT","PORTRAIT_UPSIDE_DOWN","LANDSCAPE_RIGHT","_didAccelerateFun","timestamp","_accelEnabled","_registerAccelerometerEvent","_accelCurTime","_unregisterAccelerometerEvent","_accelInterval","_registerKeyboardEvent","preventDefault","_acceleration","_accelDeviceEvent","DeviceOrientationEvent","BROWSER_TYPE_MOBILE_QQ","_deviceEventType","ua","BROWSER_TYPE_UC","_minus","didAccelerate","mAcceleration","eventAcceleration","_accelMinus","tmpX","orientation","OS_ANDROID","./CCInputManager","133","_vec2","_mousePressed","_isRegisterEvent","_preTouchPoint","_prevMousePoint","_preTouchPool","_preTouchPoolPointer","_maxTouches","_touchesIntegerDict","_indexBitsUsed","_touchesCache","_touchCount","_canvasBoundingRect","adjustedLeft","adjustedTop","_getUnUsedIndex","TOUCH_TIMEOUT","unused","locTouches","locTouchesIntDict","locTouchesCache","ccTouch","touchID","_glView","_updateCanvasBoundingRect","canvasBoundingRect","docElem","handleTouchesBegin","handleTouches","unusedIndex","_convertTouchesWithScale","handleTouchesMove","handleTouchesEnd","getSetOfTouchesEndOrCancel","handleTouchesCancel","getGlobalTouchCount","getGlobalTouches","getPreTouch","preTouch","locPreTouchPool","setPreTouch","getTouchByXY","tx","ty","locPreTouch","convertToLocationInView","getMouseEvent","locPreMouse","_convertMouseToLocationInView","getPointByEvent","BROWSER_TYPE_QQ","BROWSER_TYPE_SAFARI","pageX","pageY","scrollLeft","clientX","clientY","getTouchesByEvent","locView","touch_event","preLocation","changedTouches","identifier","selfPointer","prohibition","isMobile","supportMouse","supportTouches","_mouseEventsOnElement","focus","wheelDelta","msPointerEnabled","_pointerEventsMap","MSPointerDown","MSPointerMove","MSPointerUp","MSPointerCancel","_touchEventsMap","touchstart","touchesToHandle","touchmove","touchend","touchcancel","registerTouchEvent","_eventName","./CCMacro","./CCSys","134","DEG","SRC_ALPHA_SATURATE","SRC_COLOR","DST_ALPHA","DST_COLOR","ONE_MINUS_SRC_ALPHA","ONE_MINUS_SRC_COLOR","ONE_MINUS_DST_ALPHA","ONE_MINUS_DST_COLOR","ONE_MINUS_CONSTANT_ALPHA","ONE_MINUS_CONSTANT_COLOR","ORIENTATION_PORTRAIT","ORIENTATION_LANDSCAPE","ORIENTATION_AUTO","DENSITYDPI_DEVICE","DENSITYDPI_HIGH","DENSITYDPI_MEDIUM","DENSITYDPI_LOW","FIX_ARTIFACTS_BY_STRECHING_TEXEL_TMX","DIRECTOR_STATS_POSITION","BATCH_VERTEX_COUNT","ENABLE_TILEDMAP_CULLING","ENABLE_CULLING","SHOW_MESH_WIREFRAME","SHOW_MESH_NORMAL","KEY","none","back","backspace","tab","enter","ctrl","alt","capslock","escape","space","pageup","pagedown","home","down","select","Delete","0","f","num0","num1","num2","num3","num4","num5","num6","num7","num8","num9","*","+","-","numdel","/","f1","f2","f3","f4","f5","f6","f7","f8","f9","f10","f11","f12","numlock","scrolllock",";","semicolon","equal","=",",","comma","dash",".","forwardslash","grave","[","openbracket","backslash","]","closebracket","quote","dpadLeft","dpadRight","dpadUp","dpadDown","dpadCenter","ImageFormat","JPG","PNG","TIFF","WEBP","PVR","ETC","S3TC","ATITC","TGA","RAWDATA","BOTTOM","135","Destroyed","RealDestroyed","ToDestroy","EditorOnly","Dirty","DontDestroy","LockedInEditor","IsRotationLocked","IsScaleLocked","IsAnchorLocked","IsSizeLocked","IsPositionLocked","PersistentMask","objectsToDestroy","deferredDestroy","deleteCount","deferredDestroyTimer","compileDestruct","shouldSkipId","idToSkip","propsToReset","_destruct","__destruct__","strictMode","136","SAXParser","DOMParser","_isSupportDOMParser","_parser","xmlTxt","_parseXML","textxml","xmlDoc","parseFromString","ActiveXObject","loadXML","PlistParser","plist","childNodes","nodeType","_parseNode","_parseDict","_parseArray","firstChild","nodeValue","saxParser","137","screen","_supportsFullScreen","_onfullscreenchange","_onfullscreenerror","_preOnFullScreenChange","_preOnFullScreenError","_preOnTouch","_touchEvent","_fn","_fnMap","valL","requestFullscreen","fullScreen","fullscreenElement","webkitFullscreenElement","mozFullScreenElement","requestFullScreen","onFullScreenChange","onFullScreenError","toLowerCase","OS_IOS","isBrowser","webkitEnterFullscreen","fullscreenchange","fullscreenerror","requestPromise","exitFullScreen","webkitExitFullscreen","exitFullscreen","autoFullScreen","_ensureFullScreen","disableAutoFullScreen","touchTarget","touchEventName","fullScreenErrorEventName","onTouch","138","settingPlatform","_CCSettings","platform","isVivoGame","isOppoGame","isHuaweiGame","isJKWGame","isQttGame","isLinkSure","_global","global","initSys","LANGUAGE_ENGLISH","LANGUAGE_CHINESE","LANGUAGE_FRENCH","LANGUAGE_ITALIAN","LANGUAGE_GERMAN","LANGUAGE_SPANISH","LANGUAGE_DUTCH","LANGUAGE_RUSSIAN","LANGUAGE_KOREAN","LANGUAGE_JAPANESE","LANGUAGE_HUNGARIAN","LANGUAGE_PORTUGUESE","LANGUAGE_ARABIC","LANGUAGE_NORWEGIAN","LANGUAGE_POLISH","LANGUAGE_TURKISH","LANGUAGE_UKRAINIAN","LANGUAGE_ROMANIAN","LANGUAGE_BULGARIAN","LANGUAGE_UNKNOWN","OS_MARMALADE","OS_LINUX","OS_BADA","OS_BLACKBERRY","OS_OSX","OS_WP8","OS_WINRT","OS_UNKNOWN","WIN32","LINUX","MACOS","ANDROID","IPHONE","IPAD","BLACKBERRY","NACL","EMSCRIPTEN","TIZEN","WINRT","WP8","MOBILE_BROWSER","DESKTOP_BROWSER","EDITOR_PAGE","EDITOR_CORE","WECHAT_GAME","QQ_PLAY","FB_PLAYABLE_ADS","BAIDU_GAME","VIVO_GAME","OPPO_GAME","HUAWEI_GAME","XIAOMI_GAME","JKW_GAME","ALIPAY_GAME","WECHAT_GAME_SUB","BAIDU_GAME_SUB","QTT_GAME","BYTEDANCE_GAME","BYTEDANCE_GAME_SUB","LINKSURE","TAOBAO","BROWSER_TYPE_WECHAT","BROWSER_TYPE_ANDROID","BROWSER_TYPE_IE","BROWSER_TYPE_EDGE","BROWSER_TYPE_UCBS","BROWSER_TYPE_360","BROWSER_TYPE_BAIDU_APP","BROWSER_TYPE_BAIDU","BROWSER_TYPE_MAXTHON","BROWSER_TYPE_OPERA","BROWSER_TYPE_OUPENG","BROWSER_TYPE_MIUI","BROWSER_TYPE_CHROME","BROWSER_TYPE_LIEBAO","BROWSER_TYPE_QZONE","BROWSER_TYPE_SOUGOU","BROWSER_TYPE_HUAWEI","BROWSER_TYPE_UNKNOWN","getMaxJointMatrixSize","_maxJointMatrixSize","JOINT_MATRICES_SIZE","LEFT_UNIFORM_SIZE","maxUniforms","MAX_VERTEX_UNIFORM_VECTORS","getSafeAreaRect","visibleSize","getVisibleSize","__globalAdapter","adaptSys","languageCode","nav","doc","docEle","FbPlayableAd","currLanguage","language","browserLanguage","isAndroid","iOS","osVersion","osMainVersion","uaResult","maxTouchPoints","osName","appVersion","OS_UNIX","typeReg1","typeReg2","typeReg3","browserTypes","typeMap","micromessenger","trident","edge","360 aphone","mxbrowser","opr/","ubrowser","huaweibrowser","browserVersion","versionReg1","versionReg2","innerWidth","innerHeight","devicePixelRatio","windowPixelResolution","_checkWebGLRenderMode","_tmpCanvas1","create3DContext","opt_attribs","opt_contextType","localStorage","setItem","_supportWebp","toDataURL","_supportCanvas","_supportWebGL","WebGLRenderingContext","opengl","supportWebAudio","AudioContext","webkitAudioContext","mozAudioContext","ONLY_ONE","DELAY_CREATE_CTX","ONE_SOURCE","MULTI_CHANNEL","AUTOPLAY","canPlayType","ogg","wav","mp4","m4a","NetworkType","LAN","WWAN","getNetworkType","getBatteryLevel","garbageCollect","restartVM","isObjectValid","dump","openURL","139","__BrowserGetter","html","getElementsByTagName","availWidth","availHeight","meta","adaptationType","_scissorRect","View","_strategyer","ContainerStrategy","_strategy","ContentStrategy","_frameSize","_originalDesignResolutionSize","_visibleRect","_autoFullScreen","_maxPixelRatio","_retinaEnabled","_resizeCallback","_resizing","_resizeWithBrowserSize","_orientationChanging","_orientation","_isAdjustViewport","_antiAliasEnabled","_resolutionPolicy","_rpExactFit","EQUAL_TO_FRAME","EXACT_FIT","_rpShowAll","_rpNoBorder","_rpFixedHeight","_rpFixedWidth","_initFrameSize","_resizeEvent","forceOrEvent","prevFrameW","prevFrameH","prevRotated","containerStyle","display","_orientationChange","resizeWithBrowserSize","setResizeCallback","setOrientation","designWidth","designHeight","locFrameSize","isLandscape","transformOrigin","_setViewportMeta","metas","overwrite","vp","getElementById","head","elems","getElementsByName","currentVP","pattern","RegExp","_adjustViewportMeta","adjustViewportMeta","isRetinaEnabled","enableAntiAlias","imageSmoothingEnabled","mozImageSmoothingEnabled","isAntiAliasEnabled","enableAutoFullScreen","isAutoFullScreenEnabled","setCanvasSize","getCanvasSize","getFrameSize","setFrameSize","getVisibleSizeInPixel","getVisibleOrigin","getVisibleOriginInPixel","getResolutionPolicy","setResolutionPolicy","resolutionPolicy","_locPolicy","preApply","viewport","vb","rv","postApply","updateCameraViewport","getDesignResolutionSize","setRealPixelResolution","setViewportInPoints","locScaleX","locScaleY","setScissorInPoints","ceil","sw","sh","boxArr","SCISSOR_BOX","scissor","isScissorEnabled","SCISSOR_TEST","getScissorRect","scaleXFactor","scaleYFactor","getViewportRect","getScaleX","getScaleY","getDevicePixelRatio","relatedPos","posLeft","posTop","in_out_point","selPoint","selPrePoint","designedResolution","_setupContainer","locCanvas","_setupStyle","locContainer","_fixContainer","bs","contStyle","_result","_buildResult","containerW","containerH","contentW","contentH","EqualToFrame","frameH","ProportionalToFrame","frameW","designW","designH","offx","offy","EqualToWindow","ProportionalToWindow","OriginalContainer","globalAdapter","adaptContainerStrategy","adaptView","PROPORTION_TO_FRAME","ORIGINAL_CONTAINER","ExactFit","ShowAll","NoBorder","FixedHeight","FixedWidth","containerStg","contentStg","_containerStrategy","_contentStrategy","setContainerStrategy","setContentStrategy","140","topLeft","topRight","bottomLeft","bottomRight","141","isPlainEmptyObj","createAttrsSingle","superAttrs","createAttrs","subclass","chains","__attrs__","newAttrs","prefix","PrimitiveType","getTypeChecker","mainPropName","mainPropAttrs","mainPropAttrsType","isContainer","defaultType","type_lowerCase","getObjTypeChecker","typeCtor","classCtor","defaultDef","typename","142","CallbackInfo","callbackInfoPool","CallbackList","removeByCallback","removeByTarget","cancelAll","MAX_SIZE","callbackListPool","keyOrTarget","_list","143","deepFlatten","strList","flattenCodeArray","separator","144","_js","_vec3","_size","_quat","SUPPORT_MIN_FORMAT_VERSION","EMPTY_PLACEHOLDER","BuiltinValueTypes","BuiltinValueTypeParsers_xyzw","BuiltinValueTypeSetters","fromArray","serializeBuiltinValueTypes","typeId","toArray","DataTypeID","SimpleType","InstanceRef","Array_InstanceRef","Array_AssetRefByInnerObj","ValueTypeCreated","AssetRefByInnerObj","Array_Class","CustomizedClass","Dict","ARRAY_LENGTH","CLASS_TYPE","CLASS_KEYS","CLASS_PROP_TYPE_OFFSET","MASK_CLASS","OBJ_DATA_MASK","CUSTOM_OBJ_DATA_CLASS","CUSTOM_OBJ_DATA_CONTENT","VALUETYPE_SETTER","DICT_JSON_LAYOUT","ARRAY_ITEM_VALUES","Refs","EACH_RECORD_LENGTH","OWNER_OFFSET","KEY_OFFSET","TARGET_OFFSET","File","Version","Context","SharedUuids","SharedStrings","SharedClasses","SharedMasks","Instances","InstanceTypes","DependObjs","DependKeys","DependUuidIndices","PACKED_SECTIONS","dereference","instances","strings","dataLength","instanceOffset","keyIndex","_owner2","_keyIndex","deserializeCCObject","objectData","clazz","classTypeOffset","maskTypeOffset","_key2","ASSIGNMENTS","deserializeCustomCCObject","assignSimple","assignInstanceRef","genArrayParser","parseAssetRefByInnerObj","parseClass","parseCustomClass","parseValueTypeCreated","parseValueType","parseTRS","typedArray","parseDict","dict","_key3","_type2","subValue","parseArray","_type3","parseInstances","instanceTypes","instanceTypesLen","rootIndex","normalObjectCount","insIndex","classes","typeIndex","_type4","eachData","getMissingClass","hasCustomFinder","doLookupClass","silent","proxy","lookupClasses","customFinder","klassLayout","_type5","cacheMasks","masks","parseResult","sharedStrings","dependSharedUuids","dependObjs","dependKeys","dependUuids","_obj","_key4","details","borrowDetails","preprocessed","_version","FileInfo","sharedUuids","sharedClasses","sharedMasks","sections","rootInfo","../value-types/color","../value-types/quat","../value-types/rect","../value-types/size","../value-types/vec3","../value-types/vec4","145","./deserialize-compiled","./deserialize-editor","146","NonUuidMark","category","random","147","./CCClassDecorator","./CCObject","./CCVisibleRect","./callbacks-invoker","./instantiate","./instantiate-jit","148","Compiler","DEFAULT","VAR","LOCAL_OBJ","LOCAL_TEMP_OBJ","LOCAL_ARRAY","LINE_INDEX_OF_NEW_OBJ","DEFAULT_MODULE_CACHE","cc.Node","cc.Label","cc.Button","cc.Widget","cc.Animation","cc.ClickEvent","cc.PrefabInfo","Int8Array","Int16Array","Uint16Array","Uint32Array","Uint8ClampedArray","getTypedArrayName","Declaration","varName","mergeDeclaration","writeAssignment","codeArray","Assignments","targetExpression","_exps","_targetExp","writeCode","targetVar","pair","getPropAccessor","equalsToDefault","isEmptyObject","Parser","objsToClear_iN$t","objs","funcModuleCache","globalVariables","globalVariableId","localVariableId","getFuncModule","globalVar","enumerateObject","globalVariablesDeclaration","code","_iN$t","usedInNew","clsNameIsModule","getObjRef","setValueType","srcValue","assignments","fastDefinedProps","enumerateField","enumerateCCClass","setObjProp","instantiateArray","arrayVar","declaration","instantiateTypedArray","line","isView","instantiateObj","createCode","isChildOf","_obj$node","./compiler","149","CCValueType","_isDomNode","isDomNode","original","internal_force","doInstantiate","objsToClearTmpVar","initValue","../value-types/value-type","150","tempCIDGenerater","_getPropertyDescriptor","getPrototypeOf","_copyprop","isString","dunderProto","superclass","tmpValueDesc","tmpGetSetDesc","tmpGetDesc","tmpSetDesc","objOrCtor","__classname__","retval","isTempClassId","_idToClass","_nameToClass","setup","publicName","table","doSetClassName","unregisterClass","classId","__cid__","classname","allowTempId","obsoleted","newExpr","extractPropName","oldProp","newProp","obsoletes","objName","REGEXP_NUM_OR_STR","REGEXP_STR","argLen","hasSubstitution","regExpToTest","notReplaceFunction","forceDictMode","INVALID_IDENTIFIER_1","INVALID_IDENTIFIER_2","verifyType","removeArray","minusArr","appendObjectsAt","addObjs","arr_clone","cleanupFunc","_cleanup","resize","../utils/mutable-forward-iterator","./id-generater","151","Attrs","SerializableAttrs","TYPO_TO_CORRECT_DEV","parseNotify","newKey","newValue","canUsedInGet","parseType","STATIC_CHECK","getBaseClassWherePropertyDefined_DEV","_wrapOptions","isES6Getset","isLiteral","fullForm","maybeTypeScript","CALL_SUPER_DESTROY_REG_DEV","overrided","baseFuc","subFuc","correct","152","requiringFrames","beh","frameInfo","anyKey","153","refNode","otherNode","compareDocumentPosition","nodeName","154","./CCDirector","./asset-manager","./platform/CCInputExtension","./platform/CCInputManager","./platform/CCScreen","./platform/CCSys","./platform/CCView","155","_manager","_assertThisInitialized","ReferenceError","Assembler2D","_Assembler","initData","initLocal","createQuadData","verticesFloats","indicesCount","_local","uintVerts","uintVDatas","floatsPerVert","colorOffset","getBuffer","_handle","_meshBuffer","updateWorldVerts","local","verts","vDatas","matrix","matrixm","vl","vr","vt","vertexOffset","justTranslate","al","ar","bl","br","ct","db","fillBuffers","worldMatDirty","renderData","vData","iData","iDatas","offsetInfo","request","verticesCount","byteOffset","vbuf","_vData","ibuf","_iData","indiceOffset","vertexId","texIdOffset","uvOffset","./assembler","./utils/dynamic-atlas/manager","./webgl/render-data","156","_pool3","_assemblerId","getAssemblerId","assemblerCtor","__assemblerId__","AssemblerPool","_pool2","assemblers","_renderComp","../utils/pool","157","_vertexFormat","_assemblerPool","_extendNative","renderComp","updateRenderDataForSwitchMaterial","getVfmt","vfmtPosUvColor","packDynamicAtlasAndCheckMaterial","packedFrame","insertSpriteFrame","renderCompCtor","__assembler__","getConstructor","./assembler-pool","./webgl/vertex-format","158","Device","canvasEL","_canvas","_caps","_stats","drawcalls","_vx","_vy","_vw","_vh","_sx","_sy","_sw","_sh","_restoreTexture","unit","setViewport","setScissor","clearRect","fillStyle","globalAlpha","resetDrawCalls","getDrawCalls","159","_device","updateImage","160","_inputAssembler","_initBuiltins","defaultTexture","WRAP_REPEAT","programTemplates","programChunks","InputAssembler","Pass","renderEngine","drawCalls","_cameraNode","ModelBatcher","nativeFlow","ForwardRenderer","_builtins","canvasRenderer","RenderComponentHandle","ecScene","../../renderer/core/input-assembler","../../renderer/core/pass","../../renderer/renderers/forward-renderer","../../renderer/scene/scene","./canvas","./canvas/Device","./canvas/Texture2D","./webgl/assemblers","./webgl/model-batcher","161","FlagOfset","DONOTHING","BREAK_FLOW","LOCAL_TRANSFORM","WORLD_TRANSFORM","TRANSFORM","UPDATE_RENDER_DATA","OPACITY","OPACITY_COLOR","RENDER","POST_RENDER","FINAL","_batcher","_func","_next","_doNothing","_localTransform","_worldTransform","parentOpacityDirty","_render","batcher","parentOpacity","worldTransformFlag","worldOpacityFlag","worldDirtyFlag","colorVal","_fastSetA","flows","_postRender","postFillBuffers","EMPTY_FLOW","createFlow","flow","getFlow","tFlag","_validateList","_inValidateList","validateRenderers","visitRootNode","preCullingMask","walking","terminate","_renderScene","forwardRenderer","getBachther","FLAG_DONOTHING","FLAG_BREAK_FLOW","FLAG_LOCAL_TRANSFORM","FLAG_FINAL","162","_reusableAtlas","_atlases","_atlasIndex","_maxAtlasCount","_textureSize","_maxFrameSize","_textureBleeding","_autoMultiBatch","_autoResetBeforeSceneLoad","_debugNode","newAtlas","autoMultiBatch","requsetMaterial","beforeSceneLoad","atlasCount","textureBleeding","textureSize","autoResetBeforeSceneLoad","atlases","rects","deleteAtlasSpriteFrame","deleteTexture","deleteInnerTexture","showDebug","scroll","./reusable-atlas","163","pointer","parentRect","subRectA","subRectB","subRectC","cacheIndex","used","border","rootRect","freeRects","pushFreeRect","removeFreeRect","temp2","replaceFreeRect","score","areaFit","originalIndex","sizes","best","ignoreRectSize","deleteInnerRect","_iterator","_step","tryMergeRecycle","old","isEmpty","_iterator2","_step2","_iterator3","_step3","../../../assets/CCRenderTexture","164","_assembler2d","shareLabelInfo","LetterInfo","_tmpRect","_comp","_horizontalKernings","_lettersInfo","_linesOffsetX","_numberOfLines","_textDesiredHeight","_letterOffsetY","_tailoredTopY","_tailoredBottomY","_bmfontScale","_lineBreakWithoutSpaces","_lineSpacing","_originFontSize","_hAlign","_vAlign","_overflow","_isWrapText","_maxLineWidth","_isRetina","_retinaScale","BmfontAssembler","_Assembler2D","_reserveQuads","assemblerChanged","_updateFontFamily","_aftUpdateRenderData","_preUpdateRenderData","fontAsset","fontAtlas","_updateProperties","_updateLabelInfo","_updateContent","_resetProperties","_updateFontScale","getTTFTextureSizeScale","enableLabelRetina","labelRetinaScale","_setupBMFontOverflowMetrics","_computeHorizontalKerningForText","_alignText","stringLen","horizontalKernings","kerningDict","kerningAmount","_multilineTextWrap","nextTokenFunc","lineIndex","nextTokenY","longestLine","letterRight","highestY","lowestY","letterDef","letterPosition","_getFontScale","_recordPlaceholderInfo","tokenLen","tokenHighestY","tokenLowestY","tokenRight","nextLetterX","newLine","letterIndex","atlasName","letterX","_recordLetterInfo","_finishMultilineTextWrap","_getFirstCharLen","_multilineTextWrapByWord","_multilineTextWrapByChar","tmpInfo","_char2","_computeAlignmentOffset","_isVerticalClamp","_shrinkLabelToContentSize","_updateQuads","_isHorizontalClamp","_scaleFontSizeDown","shouldUpdateContent","lambda","mid","newFontSize","letterClamp","ctr","letterInfo","wordWidth","_isHorizontalClamped","letterOverClamp","appx","appy","clipTop","_determineRect","letterPositionX","appendQuad","_quadsUpdated","tempRect","trimmedLeft","trimmedTop","originalX","blank","../../../components/CCLabel","../../../platform/CCMacro","../../../utils/text-utils","../../assembler-2d","../utils","165","166","_bmfont","OUTLINE_SUPPORTED","getFontFamily","bleed","_invisibleAlpha","LetterTexture","labelInfo","_labelInfo","_context","_updateTexture","_canvasPool","startX","startY","MIDDLE_RATIO","BASELINE_OFFSET","textAlign","isOutlined","strokeStyle","strokeText","fillText","LetterAtlas","_tmpId","_nexty","frees","waitCleans","insertLetterTexture","letterTexture","freeLetter","removeFreeLetter","oldx","oldy","oldnexty","_letter","_inCleans","ref","pushFreeLetter","defs","LetterAtlases","fakeMaterial","_atlasWidth","_atlasHeight","deleteLetter","_iterator4","_step4","_iterator5","_step5","charAtlasAutoResetBeforeSceneLoad","_emptyTexture","_firstTraverse","_letterRefs","checkMaterialAndUpdateTexId","_usedMaterial","_needCheckMaterial","computeHash","toHEX","_isBold","LetterFontAssembler","_WebglBmfontAssembler","_proto2","createFlexData","vfmtPosUvColorTexId","_getFontDesc","_iterator6","_step6","_recycleLetterRef","_iterator7","_step7","assemblerData","appendVerts","../../../components/CCComponent","../../../components/CCLabelOutline","../../webgl/assemblers/label/2d/bmfont","../../webgl/vertex-format","167","_fontDesc","_drawFontSize","_splitedStrings","_canvasSize","_premultiply","_outlineComp","_outlineColor","_shadowComp","_shadowColor","_canvasPadding","_contentSizeExtend","_nodeContentSize","_enableItalic","_underlineThickness","_drawUnderlinePos","_drawUnderlineWidth","_sharedLabelData","Alignment","TTFAssembler","_calculateLabelFont","_updateLabelDimensions","_calDynamicAtlas","updateVerts","_updatePaddingRect","outlineWidth","shadowWidth","CC_NATIVERENDERER","_calculateFillTextStartPosition","labelX","_getLineHeight","drawStartY","firstLinelabelY","_setupOutline","_setupShadow","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","_drawTextEffect","startPosition","isMultiple","measureText","drawTextPosX","drawTextPosY","maxTextureSize","caps","recreate","nodeSpacingY","_calculateParagraphLength","paragraphedStrings","paragraphLength","_calculateShrinkFont","totalHeight","maxLength","canvasWidthNoMargin","canvasHeightNoMargin","textFragment","allWidth","_calculateWrapText","canvasSizeX","canvasSizeY","paraLength","rawWidth","rawHeight","_rawHeight","../../../components/CCLabelShadow","168","hAlign","vAlign","./dynamic-atlas/manager","169","earcut","holeIndices","dim","hasHoles","outerLen","outerNode","linkedList","minX","minY","eliminateHoles","earcutLinked","clockwise","signedArea","insertNode","removeNode","filterPoints","again","steiner","area","ear","indexCurve","isEarHashed","isEar","cureLocalIntersections","splitEarcut","pointInTriangle","minTX","minTY","maxTX","maxTY","minZ","zOrder","maxZ","nextZ","prevZ","intersects","locallyInside","isValidDiagonal","splitPolygon","queue","getLeftmost","compareX","eliminateHole","hole","findHoleBridge","hx","hy","qx","mx","my","tanMin","sortLinked","tail","numMerges","pSize","qSize","inSize","leftmost","ax","ay","bx","intersectsPolygon","middleInside","q1","inside","a2","an","bp","deviation","polygonArea","trianglesArea","flatten","holes","dimensions","holeIndex","170","Point","dmx","dmy","Path","closed","nbevel","complex","Impl","_distTol","_updatePathOffset","_paths","_pathLength","_pathOffset","_pointsOffset","_commandx","_commandy","_addPath","_curPath","pt","pathPoints","../../../../graphics/helper","../../../../graphics/types","171","MeshBuffer","Earcut","MAX_VERTEX","MAX_INDICE","atan2","curveDivs","tol","clamp","vfmtPosColorSdf","VertexFormat","ATTR_POSITION","ATTR_TYPE_FLOAT32","num","ATTR_COLOR","ATTR_TYPE_UINT8","GraphicsAssembler","_buffers","_bufferOffset","getVfmtFloatCount","requestBuffer","indiceStart","vertexStart","meshbuffer","ia","_vb","_ib","getBuffers","buffers","_flushIA","uploadData","genBuffer","cverts","maxVertsCount","requestStatic","_curColor","_flattenPaths","_expandStroke","_expandFill","impl","ncap","_calculateJoins","pointsLength","_path","pts","_pointsLength","loop","dPos","normalizeSelf","_buttCapStart","_roundCapStart","_roundJoin","_bevelJoin","_vset","floatCount","vDataoOfset","_dPos","_dx","_dy","_buttCapEnd","_roundCapEnd","indicesOffset","_start","_end","_l3","_path2","_pointsLength2","earcutData","vDataOffset","newIndices","_j2","nIndices","first","_end2","iw","w2","ptsLength","nleft","dmr2","cross","limit","dlx0","dly0","dlx1","dly1","dmwx","dmwy","dmlen2","_chooseBevel","bevel","dlx","dly","lw","rw","p1x","lx0","ly0","lx1","ly1","a0","a1","_out","rx0","ry0","rx1","ry1","_a2","_n","_u","_a3","lx","ly","_out2","uintVData","_uintVData","../../../../../renderer/core/input-assembler","../../../../graphics/graphics","../../../assembler","../../../index","../../mesh-buffer","./earcut","./impl","172","./label","./mask-assembler","./motion-streak","./motion-streak-multi","./sprite","173","MultiWebglBmfontAssembler","../../../../webgl/vertex-format","../2d/bmfont","174","_ttf","MultiWebglTTFAssembler","_WebglTTFAssembler","indices","initQuadIndices","../2d/ttf","175","_dataOffset","WebglBmfontAssembler","_BmfontAssembler","flexBuffer","_flexBuffer","reserve","vid","_getColor","rectWidth","rectHeight","uvDataOffset","retinaScale","world","../../../../utils/label/bmfont","176","WebglLetterFontAssembler","_LetterFontAssembler","createData","requestRenderData","../../../../../platform/js","../../../../utils/label/letter-font","./bmfont","177","UPDATE_CONTENT","UPDATE_FONT","UPDATE_EFFECT","NativeTTF","labelMaterial","_label","CustomAssembler","_proxy","setAssembler","_layout","jsb","LabelRenderer","_cfg","DataView","_layoutInfo","_cfgFields","_layoutFields","bindNodeProxy","_bindMaterial","_setBufferFlag","dv","getInt8","setInt8","_v","getInt32","__isLittleEndian__","setInt32","_updateCfgFlag","field","updateFlags","_setBufferValue","setFloat32","setUint8","_setFieldValue","field_name","_getBufferValue","getFloat32","getUint8","_getFieldValue","_getLayoutValue","_setLayoutValue","_updateCfgFlag_Content","_updateCfgFlag_Font","_colorEqual","_colorToObj","setString","setFontPath","fontPath","setFontSize","fontSizeRetina","oldfontsize","setOutline","oldOutline","setOutlineColor","oldColor","setLineHeight","oldLineHeight","setOverFlow","setEnableWrap","setVerticalAlign","setHorizontalAlign","oldHeight","oldX","oldY","setShadow","oldBlur","updateContent","setShadowColor","setItalic","oldItalic","setBold","oldBold","setUnderline","setSpacingX","getCache","retinaSize","getR","getG","getB","getA","shadow","outlineSize","setEffect","_nativeObj","../../../../../assets/material/CCMaterial","../../../../../assets/material/material-variant","../../../../../components/CCLabel","../../../../../components/CCLabelOutline","../../../../../components/CCLabelShadow","178","WebglTTFAssembler","_TTFAssembler","updateUVs","srcOffset","dstOffset","canvasWidth","canvasHeight","shadowOffset","../../../../utils/label/ttf","179","_CCLabel","_ttf2","_bmfont2","_letter2","_ttf3","_bmfont3","textBaseline","TTF","Bmfont","Letter","TTF3D","Bmfont3D","Letter3D","TTFMulti","BmfontMulti","../../../../components/CCLabel","./2d-multi/bmfont","./2d-multi/ttf","./2d/bmfont","./2d/letter","./2d/nativeTTF","./2d/ttf","./3d/bmfont","./3d/letter","./3d/ttf","180","MaskAssembler","SimpleSpriteAssembler","vfmtPos","_maxLevel","_maskStack","getWriteMask","getStencilRef","applyStencil","failOp","writeMask","zFailOp","zPassOp","STENCIL_ENABLE","pushMask","exitMask","_flushMaterial","enableMask","applyClearMask","DS_FUNC_NEVER","STENCIL_OP_REPLACE","STENCIL_OP_ZERO","applyAreaMask","DS_FUNC_EQUAL","_SimpleSpriteAssemble","../../../../renderer/gfx","../../../components/CCMask","../../assembler","../../render-flow","../vertex-format","./sprite/2d/simple","181","_motionStreak","setPoint","setDir","_normal","MultiMotionStreakAssembler","_MotionStreakAssemble","lastPos","moved","cur","newHead","_prev","_tailShortenTime","_prev2","difx","dify","prevIsTail","ca","crgb","vertsOffset","isLast","nextIsStatic","segmentProgress","_this$_renderData$_fl","usedVertices","usedIndices","usedVerticesFloats","MotionStreakAssembler","../../../components/CCMotionStreak","182","_tangent","_miter","computeMiter","miter","lineA","lineB","halfThick","maxMultiple","multiple","dot","183","_barFilled","BarFilledAssemblerMulti","_BarFilledAssembler","fillEnd","../2d/bar-filled","184","_mesh","MultiMeshSpriteAssembler","_MeshSpriteAssembler","updateIndices","../2d/mesh","185","_radialFilled","MultiRadialFilledAssembler","_RadialFilledAssemble","../2d/radial-filled","186","_simple","MultiSimpleSpriteAssembler","../2d/simple","187","_sliced","MultiSlicedAssembler","_SlicedAssembler","meshCount","indexOffset","../2d/sliced","188","_tiled","MultiTiledAssembler","_TiledAssembler","contentWidth","contentHeight","sizableWidth","sizableHeight","hRepeat","vRepeat","_updateIndices","../2d/tiled","189","BarFilledAssembler","textureRect","ul","ur","quadUV0","quadUV1","quadUV2","quadUV3","quadUV4","quadUV5","quadUV6","quadUV7","progressStart","progressEnd","../../../../../components/CCSprite","../../../../assembler-2d","190","MeshSpriteAssembler","originalWidth","originalHeight","trimX","trimY","191","PI_2","_vertPos","_vertices","_uvs","_intersectPoint_1","_intersectPoint_2","_center","_triangles","_calcInsectedPoints","intersectPoints","sinAngle","cosAngle","tanAngle","cotAngle","yleft","yright","xtop","xbottom","_calculateVertices","_calculateUVs","u0","v0","_getVertAngle","placementX","placementY","RadialFilledAssembler","floatsPerTriangle","triangleIndex","triangle","_generateTriangle","testIndex","allocWorldVerts","vert0","vert1","vert2","v0x","v0y","v1x","v1y","progressX","progressY","_generateUV","px1","px2","py1","py2","192","cw","ch","ow","oh","rh","trimRight","trimBottom","trimTop","193","SlicedAssembler","xScale","yScale","voffset","localRowY","localColX","worldIndex","194","TiledAssembler","_this$_local","offsetWidth","offsetHeight","localX","localY","yindex","ylength","xindex","xlength","coefu","coefv","tempXVerts","tempYVerts","195","_CCSprite","_simple2","_sliced2","_tiled2","_radialFilled2","_barFilled2","_mesh2","_simple3","_sliced3","_tiled3","_radialFilled3","_barFilled3","_mesh3","Simple","Sliced","Tiled","RadialFilled","BarFilled","Mesh","Simple3D","Sliced3D","Tiled3D","RadialFilled3D","BarFilled3D","Mesh3D","SimpleMulti","SlicedMulti","TiledMulti","RadialFilledMulti","BarFilledMulti","MeshMulti","../../../../components/CCSprite","./2d-multi/bar-filled","./2d-multi/mesh","./2d-multi/radial-filled","./2d-multi/simple","./2d-multi/sliced","./2d-multi/tiled","./2d/bar-filled","./2d/mesh","./2d/radial-filled","./2d/simple","./2d/sliced","./2d/tiled","./3d/bar-filled","./3d/mesh","./3d/radial-filled","./3d/simple","./3d/sliced","./3d/tiled","196","FlexBuffer","vfmt","_handler","_index","_vfmt","_verticesBytes","_bytes","_initVerticesCount","_initIndicesCount","_reallocVData","floatsCount","oldData","updateMesh","_reallocIData","newFloatsCount","realloced","newIndicesCount","updateMeshRange","197","FIX_IOS14_BUFFER","_GameGlobal","GameGlobal","isIOSHighPerformanceMode","vertexFormat","_vertexBytes","_arrOffset","_vbArr","VertexBuffer","USAGE_DYNAMIC","_ibArr","IndexBuffer","INDEX_FMT_UINT16","USAGE_STATIC","_initVDataCount","_initIDataCount","_offsetInfo","_reallocBuffer","vertexsData","indicesData","ib","switchBuffer","checkAndSwitchBuffer","vertexCount","indiceCount","byteLength","indiceLength","_updateOffset","requestForSpine","requestStaticForSpine","adjustForSpine","copyOldData","oldVData","newData","oldIData","forwardIndiceStartToOffset","../../../renderer/gfx","198","_recyclePool","_model","vfmt3D","QuadBuffer","SpineBuffer","empty_material","empty_ia","renderScene","_iaPool","_modelPool","_quadBuffer","_quadBuffer3D","_meshBuffer3D","_batchedModels","_sortKey","models","setInputAssembler","removeModel","model","sortKey","addModel","_vertexBuffer","_indexBuffer","vertextFormat","../../../renderer/core/input-assembler","../../../renderer/memop/recycle-pool","../../../renderer/scene/model","../../assets/material/CCMaterial","../../platform/id-generater","./mesh-buffer","./quad-buffer","./spine-buffer","./vertex-format","199","_fillQuadBuffer","vertextID","200","RenderData","_infos","./flex-buffer","201","adjust","202","ATTR_UV0","XYZ_UV_Color","XY_UV_Color","ATTR_TEX_ID","XY_UV_Color_TexId","vfmtPosUvTwoColor","ATTR_COLOR0","XY_UV_Two_Color","vfmtPosUvTwoColorTexId","XY_UV_Two_Color_TexId","vfmtPosUv","XY_UV","vfmtPosColor","XY_Color","XY","203","./multi-batcher","./multi-handler","204","MultiBatcher","handlers","nextHandler","getEmptyIndex","205","textures","hasEmptySlot","texture2","texture3","texture4","texture5","texture6","texture7","texture8","propertyIndex2Name","hasTexture","206","i2nMap","n2iMap","propertyName2Index","207","EXTNAME_RE","DIRNAME_RE","NORMALIZE_RE","pathStr","mainFileName","fileName","reg","baseName","tempStr","changeBasename","isSameExt","_normalize","oldUrl","sep","stripSep","208","AffineTransform","determinant","matm","transformVec2","transOrY","transformSize","transformRect","ol","ob","or","ot","lbx","lby","rbx","rby","ltx","lty","rtx","rty","transformObb","out_bl","out_tl","out_tr","out_br","anAffineTransform","209","findComponent","findComponents","_comp2","findChildComponent","findChildComponents","couldActiveInScene","_onSetParent","getChildByName","siblingIndex","siblings","oldIndex","walk","prefunc","postfunc","afterChildren","_stacks","_stackId","removeAllChildren","_checkMultipleComp","existing","_RFpeek","ReqComp","depended","attachedObjsForEditor","_addComponentAt","removeComponent","_getDependComponent","destroyAllChildren","newParent","inCurrentSceneBefore","inCurrentSceneNow","newPrefabRoot","myPrefabInfo","shouldActiveNow","isSyncedNode","newPrefabInfo","syncing","_registerIfAttached","_comp3","childIndex","SameNameGetSets","propertyDefine","./misc","210","211","_dstBlendFactor","_updateBlendFunc","dstBlendFactor","materialVar","_updateMaterialBlendFunc","212","Base64Values","BASE64_VALUES","HexChars","UuidTemplate","Indices","isFinite","base64","lhs","rhs","213","referenceNode","nameList","subChild","214","_normalMaterial","normalMaterial","_grayMaterial","grayMaterial","215","eventRegx","imageAttrReg","_parsedObject","_specialSymbolArray","htmlString","_resultObjectArray","_stack","tagEndIndex","tagBeginIndex","noTagBegin","_processResult","newStr","tagStr","_addToStack","_attributeToObject","attribute","nextSpace","eventObj","eventHanlderString","_processEventHandler","isNewLine","tagValue","remainingArgument","isValidImageTag","toLocaleLowerCase","defaultOutlineObject","outlineAttrReg","eventString","eventNames","isValidTag","eventValue","previousTagObj","_escapeSpecialSymbol","216","./CCPath","./find","./mutable-forward-iterator","./profiler/CCProfiler","217","sameNameGetSets","diffNameGetSets","np","getterFunc","suffix","NextPOT","BUILTIN_CLASSID_RE","BASE64_KEYS","pushToMap","pushFront","exists","min_inclusive","max_inclusive","degreesToRadians","radiansToDegrees","218","219","220","_PrefabInfo","fileId","eulerAnglesX","eulerAnglesY","eulerAnglesZ","prefabRoot","221","PerfCounter","_showFPS","_rootNode","generateStats","below","average","draws","logic","_counter","generateNode","leftLabel","rightLabel","beforeUpdate","afterUpdate","updateLabel","stat","human","afterDraw","../../platform/CCMacro","./perf-counter","222","Counter","_value","_averageValue","_accumValue","_accumSamples","_accumStart","_average","alarm","over","223","tick","avg","./counter","224","_BASELINE_RATIO","_BASELINE_OFFSET","MAX_CACHE_SIZE","LRUCache","moveToHead","discard","measureCache","label_wordRex","label_symbolRex","label_lastWordRex","label_lastEnglish","label_firstEnglish","highSurrogateRex","lowSurrogateRex","label_wrapinspection","__CHINESE_REG","__JAPANESE_REG","__KOREAN_REG","metric","_safeSubstring","targetString","endIndex","newStartIndex","newEndIndex","startChar","endChar","wrappedWords","fuzzyLen","tmpText","sLine","pushNum","checkWhile","checkCount","sText","225","loadImage","tex","cacheImage","postLoadTexture","../assets/CCTexture2D","226","NodeUnit","./node-mem-pool","./node-unit","227","MemPool","unitClass","_unitClass","_findOrder","_initNative","_nativeMemPool","_buildUnit","unitID","_destroyUnit","_findUnitID","findUnit","findOrder","hasSpace","firstUnit","isAllFree","228","Super","./mem-pool","229","Uint32_Bytes","Uint8_Bytes","Dirty_Type","Dirty_Members","Dirty_Stride","TRS_Members","TRS_Stride","FLOAT_BYTES","LocalMatrix_Members","LocalMatrix_Stride","WorldMatrix_Members","WorldMatrix_Stride","Parent_Type","Parent_Members","Parent_Stride","ZOrder_Type","ZOrder_Members","ZOrder_Stride","CullingMask_Type","CullingMask_Members","CullingMask_Stride","Opacity_Type","Opacity_Members","Opacity_Stride","Is3D_Type","Is3D_Members","Is3D_Stride","Node_Type","Node_Members","Skew_Members","Skew_Stride","UnitBase","memPool","contentNum","_contentNum","trsList","FLOAT_ARRAY_TYPE","localMatList","worldMatList","_spacesData","../../value-types/utils","./unit-base","230","POINTER_INVALID_FLAG","SPACE_FREE_FLAG","SPACE_USE_FLAG","POS_NEXT_FREE","POS_FREE_FLAG","_memPool","_signData","signIndex","UnitBaseProto","headFreeIndex","spaceNum","freeStr","usingNum","usingStr","freeFlag","totalNum","231","_valueType","_CCClass","_misc","_ValueType","fromHex","hex","hexString","subtract","multiply","divide","ag","ofs","setR","setG","setB","setA","toCSS","opt","fmt","toRGBValue","fromHSV","toHSV","hsv","WHITE_R","BLACK_R","TRANSPARENT_R","GRAY_R","RED_R","RED","GREEN_R","GREEN","BLUE_R","BLUE","YELLOW_R","YELLOW","ORANGE_R","ORANGE","CYAN_R","CYAN","MAGENTA_R","MAGENTA","./value-type","232","_exportNames","Vec4","Mat3","_mat2","math","./color","./mat3","./mat4","./quat","./rect","./size","./trs","./vec2","./vec3","./vec4","233","m00","m01","m02","m03","m04","m05","m06","m07","m08","m10","m11","m20","m21","m22","transpose","a01","a02","a12","a00","a10","a11","a20","a21","a22","b01","b11","b21","det","adjoint","b00","b02","b10","b12","b20","b22","multiplyMat4","translate","rotate","rad","fromTranslation","fromScaling","fromQuat","z2","xx","yx","yy","zx","zy","zz","wx","wy","wz","_fromViewUpIIFE","default_up","lengthSqr","normalFromMat4","a03","a13","a23","a30","a31","a32","a33","b03","b04","b05","b06","b07","b08","b09","frob","multiplyScalar","multiplyScalarAndAdd","exactEquals","a4","a5","a6","a7","a8","b0","b5","b6","b7","b8","IDENTITY","../value-types/utils","234","_a00","_a01","_a02","_a03","_a10","_a11","_a12","_a13","_a20","_a21","_a22","_a23","_a30","_a31","_a32","_a33","mulScalar","m23","m30","m31","m32","m33","axis","rotateX","rotateY","rotateZ","fromXRotation","fromYRotation","fromZRotation","xy","xz","yz","getTranslation","getScaling","m3","m3_1","m09","trace","S","toRTS","v3_1","fromMat3","fromRTS","sz","fromRTSOrigin","ox","oy","oz","frustum","near","far","rl","tb","nf","perspective","fovy","aspect","lr","bt","eye","eyex","eyey","eyez","upx","upy","upz","centerx","centery","centerz","z0","z1","inverseTranspose","strictEquals","epsilon","sm","number","m14","m15","235","_z","_w","rotationTo","fromAxisAngle","getAxisAngle","outAxis","scaleAndAdd","bw","bz","rotateAround","rot","qt_1","rotateAroundLocal","calculateW","slerp","scale0","scale1","cosom","omega","sinom","sqlerp","qt_2","invDot","fromAxes","xAxis","yAxis","zAxis","halfToRad","_s","_s2","_s3","cz","toAxisX","fy","fz","toAxisY","fx","toAxisZ","outerZ","bank","heading","attitude","toDegree","sqx","sqy","sqz","euler","236","fromMinMax","min_x","min_y","max_x","max_y","maxax","maxay","maxbx","maxby","intersection","rectB","axMin","ayMin","axMax","ayMax","bxMin","byMin","bxMax","byMax","containsRect","aw","ah","bh","237","ZERO_R","238","tmp_quat","239","INT_MIN","INT_MAX","INT_BITS","inverseLerp","nextPow2","pingPong","pseudoRandom","pseudoRandomRange","pseudoRandomRangeInt","randomRange","randomRangeInt","toRadian","_d2r","_r2d","maxDiff","seed","240","241","neg","negate","squaredDistance","inverse","transformMat3","v2_1","v2_2","cosine","magSqr","subSelf","mulSelf","divSelf","scaleSelf","negSelf","variance","addSelf","invsqrt","magSqr1","magSqr2","theta","signAngle","radians","rotateSelf","project","maxAxis","squaredMagnitude","ONE_R","UP_R","RIGHT_R","242","zero","az","cosTheta","sinTheta","rhw","transformMat4Normal","transformAffine","ix","iy","iz","transformRTS","transformInverseRTS","rz","v3_2","projectOnPlane","sqrLen","vec1","vec2","FRONT_R","243","v4","equals4f","strictEquals4f","minInclusive","maxInclusive","NEG_ONE_R","NEG_ONE","244","deprecateEnum","oldPath","newPath","hasTypePrefixBefore","delimiter","oldPropName","oldTypeName","markAsRemoved","ownerCtor","removedProps","ownerName","markAsDeprecated","deprecatedProps","descriptors","getOwnPropertyDescriptors","deprecatedProp","markAsRemovedInObject","ownerObj","provideClearError","Info","accessor","etProp","markFunctionWarning","originFunc","_glID","PI2","FLT_MAX","FLT_MIN","UINT_MAX","scheduleCallbackForTarget","scheduleUpdateForTarget","unscheduleCallbackForTarget","unscheduleUpdateForTarget","unscheduleAllCallbacksForTarget","unscheduleAllCallbacksWithMinPriority","adjustViewPort","setViewPortInPoints","getViewPortRect","getChildByTag","removeChildByTag","getRotationX","setRotationX","getRotationY","setRotationY","getPositionX","setPositionX","getPositionY","setPositionY","getSkewX","setSkewX","getSkewY","setSkewY","setScaleX","setScaleY","getOpacity","setOpacity","getColor","getLocalZOrder","setLocalZOrder","setInsetLeft","setInsetRight","setInsetTop","setInsetBottom","getInstantiatedBuiltinMaterial","getInstantiatedMaterial","ERR","Light","affineTransformMake","affineTransformMakeIdentity","affineTransformClone","affineTransformConcat","affineTransformConcatIn","affineTransformInvert","affineTransformInvertIn","affineTransformInvertOut","affineTransformEqualToTransform","pointApplyAffineTransform","sizeApplyAffineTransform","rectApplyAffineTransform","obbApplyAffineTransform","pointEqualToPoint","sizeEqualToSize","rectEqualToRect","rectContainsRect","rectContainsPoint","rectOverlapsRect","rectIntersectsRect","rectIntersection","rectUnion","rectGetMaxX","rectGetMidX","rectGetMinX","rectGetMaxY","rectGetMidY","rectGetMinY","colorEqual","hexToColor","colorToHex","pNeg","pAdd","pSub","pMult","pMidpoint","pDot","pCross","pPerp","pRPerp","pProject","pLengthSQ","pDistanceSQ","pLength","pDistance","pNormalize","pForAngle","pToAngle","pZeroIn","pIn","pMultIn","pSubIn","pAddIn","pNormalizeIn","pSameAs","pAngle","pAngleSigned","pRotateByAngle","pCompMult","pFuzzyEqual","pLerp","pClamp","rand","randomMinus1To1","_renderType","_getError","_initDebugSetting","rgb2hsv","hsv2rgb","dragonBones","CCFactory","getInstance","vmath","245","./actions","./core/CCGame","246","CCSpriteFrame","ParticleAsset","../core/assets/CCAsset","../core/assets/CCSpriteFrame","247","USAGE_STREAM","INDEX_FMT_UINT8","INDEX_FMT_UINT32","ATTR_NORMAL","ATTR_TANGENT","ATTR_BITANGENT","ATTR_WEIGHTS","ATTR_JOINTS","ATTR_COLOR1","ATTR_UV","ATTR_UV1","ATTR_UV2","ATTR_UV3","ATTR_UV4","ATTR_UV5","ATTR_UV6","ATTR_UV7","ATTR_TYPE_INT8","ATTR_TYPE_INT16","ATTR_TYPE_UINT16","ATTR_TYPE_INT32","ATTR_TYPE_UINT32","FILTER_NEAREST","FILTER_LINEAR","WRAP_CLAMP","WRAP_MIRROR","TEXTURE_FMT_RGB_DXT1","TEXTURE_FMT_RGBA_DXT1","TEXTURE_FMT_RGBA_DXT3","TEXTURE_FMT_RGBA_DXT5","TEXTURE_FMT_RGB16F","TEXTURE_FMT_RGBA16F","TEXTURE_FMT_RGB32F","TEXTURE_FMT_R32F","TEXTURE_FMT_111110F","TEXTURE_FMT_SRGB","TEXTURE_FMT_SRGBA","TEXTURE_FMT_D16","TEXTURE_FMT_D32","TEXTURE_FMT_D24S8","DS_FUNC_LEQUAL","DS_FUNC_GREATER","DS_FUNC_NOTEQUAL","DS_FUNC_GEQUAL","RB_FMT_RGBA4","RB_FMT_RGB5_A1","RB_FMT_RGB565","BLEND_FUNC_SUBTRACT","BLEND_FUNC_REVERSE_SUBTRACT","BLEND_ZERO","BLEND_ONE","BLEND_SRC_COLOR","BLEND_ONE_MINUS_SRC_COLOR","BLEND_DST_COLOR","BLEND_ONE_MINUS_DST_COLOR","BLEND_DST_ALPHA","BLEND_ONE_MINUS_DST_ALPHA","BLEND_CONSTANT_COLOR","BLEND_ONE_MINUS_CONSTANT_COLOR","BLEND_CONSTANT_ALPHA","BLEND_ONE_MINUS_CONSTANT_ALPHA","BLEND_SRC_ALPHA_SATURATE","STENCIL_OP_INCR","STENCIL_OP_INCR_WRAP","STENCIL_OP_DECR","STENCIL_OP_DECR_WRAP","STENCIL_OP_INVERT","CULL_NONE","CULL_FRONT","CULL_FRONT_AND_BACK","PT_POINTS","PT_LINES","PT_LINE_LOOP","PT_LINE_STRIP","PT_TRIANGLES","PT_TRIANGLE_STRIP","PT_TRIANGLE_FAN","RenderQueue","OVERLAY","murmurhash2_32_gc","WebGLEXT","GFXObjectType","GFXStatus","GFXObject","gfxType","_gfxType","_status","UNREADY","GFXAttributeName","GFXType","GFXFormat","GFXBufferUsageBit","GFXMemoryUsageBit","GFXBufferAccessBit","GFXPrimitiveMode","GFXPolygonMode","GFXShadeModel","GFXCullMode","GFXComparisonFunc","GFXStencilOp","GFXBlendOp","GFXBlendFactor","GFXColorMask","GFXFilter","GFXAddress","GFXTextureType","GFXTextureUsageBit","GFXSampleCount","GFXTextureFlagBit","GFXTextureViewType","GFXShaderType","GFXBindingType","GFXCommandBufferType","GFXLoadOp","GFXStoreOp","GFXTextureLayout","GFXPipelineBindPoint","GFXDynamicState","GFXStencilFace","GFXQueueType","GFXClearFlag","GFXGetTypeSize","BOOL","INT","UINT","FLOAT","BOOL2","INT2","UINT2","FLOAT2","BOOL3","INT3","UINT3","FLOAT3","BOOL4","INT4","UINT4","FLOAT4","MAT2","MAT2X3","MAT2X4","MAT3X2","MAT3","MAT3X4","MAT4X2","MAT4","SAMPLER1D","SAMPLER1D_ARRAY","SAMPLER2D","SAMPLER2D_ARRAY","SAMPLER3D","SAMPLER_CUBE","RenderPassStage","RenderPriority","MAX_BINDING_SUPPORTED","UniformBinding","SamplerInfoIndex","sizeMap","formatMap","R32I","RG32I","RGB32I","RGBA32I","R32F","RG32F","RGB32F","passParams","BACK","FRONT","ADD","SUB","REV_SUB","CONSTANT_COLOR","CONSTANT_ALPHA","NEVER","LESS","EQUAL","LEQUAL","GREATER","NOTEQUAL","GEQUAL","KEEP","REPLACE","INCR","INCR_WRAP","DECR","DECR_WRAP","INVERT","effectStructure","$techniques","$passes","any","sampler","mappings","248","_memop","_m4_tmp","_stageInfos","RecyclePool","_float2_pool","_float3_pool","_float4_pool","_float9_pool","_float16_pool","_float64_pool","_int2_pool","_int3_pool","_int4_pool","_int64_pool","Base","_this$_type2defaultVa","_type2defaultValue","PARAM_INT2","PARAM_INT3","PARAM_INT4","PARAM_FLOAT2","PARAM_FLOAT3","PARAM_FLOAT4","PARAM_COLOR4","PARAM_MAT3","PARAM_MAT4","defaultTextureCube","_stage2fn","_usedTextureUnits","_viewPools","_drawItemsPools","_stageItemsPools","_definesChanged","_resetTextuerUnit","_allocTextureUnit","maxTextureUnits","_registerStage","fn","_requestView","clearOpts","CLEAR_COLOR","CLEAR_DEPTH","CLEAR_STENCIL","_stencil","_models","drawItem","extractDrawItem","_stages","stageItems","_drawItem","stageItem","stageInfo","_setProperty","slots","setTextureArray","setUniformDirectly","setUniform","_draw","programLib","_programKey","setVertexBuffer","setIndexBuffer","setPrimitiveType","_primitiveType","getProgram","setProgram","_uniforms","variants","enableBlend","setBlendFuncSep","setBlendEqSep","setBlendColor32","enableDepthTest","setDepthFunc","enableDepthWrite","setStencilTest","setStencilFuncFront","setStencilOpFront","setStencilFuncBack","setStencilOpBack","draw","../../core/value-types","../enums","../gfx","../memop","./program-lib","./view","249","250","_detailName","setStage","newProperties","../../core/value-types/value-type","251","_shdID","_generateDefines","tmpDefines","_replaceMacroNums","_unrollLoops","begin","snippet","unroll","parsedBegin","parsedEnd","_replaceHighp","ProgramLib","_templates","_checkPrecision","prog","glsl1","vert","frag","cnt","log2","samplers","blocks","members","extensions","hasProgram","getKey","tmpl","tmplDefs","errPrefix","customDef","_highpSupported","Program","errors","link","vertLines","fragLines","defineLength","originLine","lines","fileID","highpSupported","getShaderPrecisionFormat","vertHighp","VERTEX_SHADER","HIGH_FLOAT","fragHighp","FRAGMENT_SHADER","precision","252","Technique","253","_genID","_priority","_clearModel","_matView","_matViewInv","_matProj","_matViewProj","_matInvViewProj","_cullingByID","_shadowLight","getForward","254","_mappings","PROJ_PERSPECTIVE","PROJ_ORTHO","LIGHT_DIRECTIONAL","LIGHT_POINT","LIGHT_SPOT","LIGHT_AMBIENT","SHADOW_NONE","SHADOW_HARD","SHADOW_SOFT","ivec2","ivec3","ivec4","vec3","vec4","PARAM_MAT2","mat2","mat3","sampler2D","samplerCube","CLEAR_SKYBOX","BUFFER_VIEW_INT8","BUFFER_VIEW_UINT8","BUFFER_VIEW_INT16","BUFFER_VIEW_UINT16","BUFFER_VIEW_INT32","BUFFER_VIEW_UINT32","BUFFER_VIEW_FLOAT32","./build/mappings","255","_state","_texture2d","_textureCube","_type2uniformCommit2","_type2uniformArrayCom","GL_INT","GL_FLOAT","GL_FLOAT_VEC2","GL_FLOAT_VEC3","GL_FLOAT_VEC4","GL_INT_VEC2","GL_INT_VEC3","GL_INT_VEC4","GL_BOOL","GL_BOOL_VEC2","GL_BOOL_VEC3","GL_BOOL_VEC4","GL_FLOAT_MAT2","GL_FLOAT_MAT3","GL_FLOAT_MAT4","GL_SAMPLER_2D","GL_SAMPLER_CUBE","_type2uniformCommit","uniform1i","uniform1f","uniform2fv","uniform3fv","uniform4fv","uniform2iv","uniform3iv","uniform4iv","uniformMatrix2fv","uniformMatrix3fv","uniformMatrix4fv","_type2uniformArrayCommit","uniform1iv","uniform1fv","_commitBlendStates","disable","BLEND","blendSep","blendFuncSeparate","blendEquationSeparate","blendFunc","blendEquation","_commitDepthStates","DEPTH_TEST","depthMask","_commitStencilStates","STENCIL_TEST","stencilSep","stencilFuncSeparate","stencilMaskSeparate","stencilOpSeparate","stencilOp","_commitCullMode","CULL_FACE","cullFace","_commitVertexBuffers","attrsDirty","maxStream","vertexBuffers","vertexBufferOffsets","maxVertexAttribs","_newAttributes","vbOffset","bindBuffer","ARRAY_BUFFER","_attributes","_enabledAttributes","enableVertexAttribArray","vertexAttribPointer","stride","disableVertexAttribArray","_commitTextures","maxTextureSlot","textureUnits","activeTexture","TEXTURE0","bindTexture","_attach","attachment","face","framebufferTexture2D","TEXTURE_2D","TEXTURE_CUBE_MAP_POSITIVE_X","framebufferRenderbuffer","RENDERBUFFER","preserveDrawingBuffer","_extensions","_initExtensions","_initCaps","_initStates","initDefault","_current","vendorPrefixes","getExtension","extDrawBuffers","maxVertexStreams","maxVertexTextures","MAX_VERTEX_TEXTURE_IMAGE_UNITS","maxFragUniforms","MAX_FRAGMENT_UNIFORM_VECTORS","MAX_TEXTURE_IMAGE_UNITS","MAX_VERTEX_ATTRIBS","MAX_TEXTURE_SIZE","maxDrawBuffers","MAX_DRAW_BUFFERS_WEBGL","maxColorAttachments","MAX_COLOR_ATTACHMENTS_WEBGL","FUNC_ADD","colorMask","POLYGON_OFFSET_FILL","depthRange","clearDepth","clearStencil","_restoreIndexBuffer","indexBuffer","ELEMENT_ARRAY_BUFFER","allowFloatTexture","fb","numColors","_colors","colorBuffer","COLOR_ATTACHMENT0","DEPTH_ATTACHMENT","STENCIL_ATTACHMENT","_depthStencil","DEPTH_STENCIL_ATTACHMENT","COLOR_BUFFER_BIT","DEPTH_BUFFER_BIT","STENCIL_BUFFER_BIT","setStencilFunc","setStencilOp","rgba","setBlendColor","setBlendFunc","dst","srcAlpha","dstAlpha","setBlendEq","eq","alphaEq","stream","slot","sameType","isFloat32Array","isInt32Array","programDirty","_linked","useProgram","commitFunc","drawElements","_bytesPerIndex","drawArrays","./enums","./state","./texture-2d","./texture-cube","256","attrTypeBytes","glFilter","glTextureFmt","GL_NEAREST_MIPMAP_NEAREST","GL_LINEAR_MIPMAP_NEAREST","GL_NEAREST_MIPMAP_LINEAR","GL_LINEAR_MIPMAP_LINEAR","GL_UNSIGNED_BYTE","GL_UNSIGNED_SHORT","GL_UNSIGNED_INT","GL_UNSIGNED_SHORT_5_6_5","GL_UNSIGNED_SHORT_4_4_4_4","GL_UNSIGNED_SHORT_5_5_5_1","GL_HALF_FLOAT_OES","GL_DEPTH_COMPONENT","GL_ALPHA","GL_RGB","GL_LUMINANCE","GL_LUMINANCE_ALPHA","GL_COMPRESSED_RGB_S3TC_DXT1_EXT","GL_COMPRESSED_RGBA_S3TC_DXT1_EXT","GL_COMPRESSED_RGBA_S3TC_DXT3_EXT","GL_COMPRESSED_RGBA_S3TC_DXT5_EXT","GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG","GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG","GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG","GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG","GL_COMPRESSED_RGB_ETC1_WEBGL","GL_COMPRESSED_RGB8_ETC2","GL_COMPRESSED_RGBA8_ETC2_EAC","_filterGL","_textureFmtGL","internalFormat","pixelType","ATTR_TEX_COORD","ATTR_TEX_COORD1","ATTR_TEX_COORD2","ATTR_TEX_COORD3","ATTR_TEX_COORD4","ATTR_TEX_COORD5","ATTR_TEX_COORD6","ATTR_TEX_COORD7","ATTR_TEX_COORD8","attrType","LINEAR_MIPMAP_LINEAR","257","createFramebuffer","deleteFramebuffer","258","_BYTES_PER_INDEX","BYTES_PER_INDEX","usage","_usage","_numIndices","_needExpandDataStore","createBuffer","deleteBuffer","bytes","glUsage","bufferData","bufferSubData","setUsage","259","TextureCube","./device","./frame-buffer","./index-buffer","./program","./render-buffer","./texture","./vertex-buffer","260","isPow2","261","_parseError","errorLog","parts","_samplers","_errors","_vertSource","_fragSource","vertShader","_createShader","fragShader","createProgram","attachShader","linkProgram","failed","getShaderParameter","COMPILE_STATUS","getShaderInfoLog","deleteShader","getProgramParameter","LINK_STATUS","getProgramInfoLog","numAttributes","ACTIVE_ATTRIBUTES","getActiveAttrib","getAttribLocation","numUniforms","ACTIVE_UNIFORMS","_info","getActiveUniform","_location","getUniformLocation","deleteProgram","shader","createShader","shaderSource","compileShader","262","createRenderbuffer","bindRenderbuffer","renderbufferStorage","deleteRenderbuffer","263","cpy","264","_Texture","_genMipmap","textureMaxSize","pot","_setMipmap","hint","GENERATE_MIPMAP_HINT","NICEST","generateMipmap","_setTexInfo","glFmt","_setSubImage","_setImage","pixelStorei","UNPACK_FLIP_Y_WEBGL","UNPACK_PREMULTIPLY_ALPHA_WEBGL","compressedTexSubImage2D","texSubImage2D","compressedTexImage2D","texImage2D","texParameteri","TEXTURE_MIN_FILTER","TEXTURE_MAG_FILTER","TEXTURE_WRAP_S","TEXTURE_WRAP_T","TEXTURE_MAX_ANISOTROPY_EXT","265","TEXTURE_CUBE_MAP","faceIndex","levelImages","266","_nullWebGLTexture","_textureID","267","_bytesPerVertex","_numVertices","getFormat","268","_attr2el","_elements","_el","../murmurhash2_gc","269","CircularPool","_cursor","270","_timsort","FixedArray","cmp","./timsort","271","TypedArrayPool","LinkedArray","_circularPool","_fixedArray","_linkedArray","_typedArrayPool","./circular-pool","./fixed-array","./linked-array","./pool","./recycle-pool","./typed-array-pool","272","_head","_tail","alloc","free","binder","cursor","273","_idx","_frees","_expand","274","275","DEFAULT_MIN_MERGE","DEFAULT_MIN_GALLOPING","DEFAULT_TMP_STORAGE_LENGTH","POWERS_OF_TEN","log10","alphabeticalCompare","aStr","bStr","minRunLength","makeAscendingRun","lo","hi","compare","runHi","reverseRun","binaryInsertionSort","pivot","gallopLeft","lastOffset","maxOffset","gallopRight","TimSort","minGallop","tmpStorageLength","stackLength","runStart","runLength","stackSize","pushRun","mergeRuns","mergeAt","forceMergeRuns","start1","length1","start2","length2","mergeLow","mergeHigh","cursor1","cursor2","count1","count2","exit","customCursor","customDest","remaining","ts","minRun","276","_bufferPools","_nextPow16","_log2","_alloc","buf","alloc_int8","alloc_uint8","alloc_int16","alloc_uint16","alloc_int32","alloc_uint32","alloc_float32","alloc_float64","alloc_dataview","277","278","_baseRenderer","_a16_view","_a16_view_inv","_a16_proj","_a16_viewProj","_a4_camPos","_a64_shadow_lightViewProj","_a16_shadow_lightViewProjs","_a4_shadow_info","_camPos","_camFwd","_v3_tmp1","CC_MAX_LIGHTS","CC_MAX_SHADOW_LIGHTS","sortView","_BaseRenderer","_lights","_shadowLights","_numLights","_shadowStage","_opaqueStage","_transparentStage","_updateLights","extractView","_view2","lights","light","shadowType","_updateLightDefines","lightKey","shadowKey","_shadowType","newCount","CC_NUM_LIGHTS","CC_NUM_SHADOW_LIGHTS","_submitLightsUniforms","positionAndRanges","directions","lightNum","_colorUniform","_directionUniform","_positionUniform","_range","_spotUniform","_submitShadowStageUniforms","shadowInfo","shadowMinDepth","shadowMaxDepth","shadowDepthScale","shadowDarkness","shadowBias","CC_SHADOW_TYPE","_submitOtherStagesUniforms","viewProjMatrix","_shadowResolution","_sortItems","_drawItems","shadowLights","_item","shadowIdx","shadowMap","../core/base-renderer","279","_tmp_mat4","_tmp_v3","_tmp2_v3","_poolID","_projection","_near","_far","_orthoHeight","setCullingMask","getPriority","getOrthoHeight","getFov","getNear","getFar","getDepth","getStencil","getClearFlags","getStages","getFramebuffer","framebuffer","_calcMatrices","screenPointToRay","worldPos","worldMatrixToScreen","worldMatrix","halfWidth","halfHeight","../../core/geom-utils","280","Model","_viewID","_cameraID","_userKey","_castShadow","_boundingShape","setUserKey","281","app","_app","_views","_add","_remove","setDebugCamera","cam","getCameraCount","getCamera","getModelCount","getModel","getLightCount","getLight","addLight","removeLight","addView","removeView","282","ctor2enums","getInspectorProps","getInstanceType","getInstanceCtor","_CCTexture2D","_ctor2default","_enums2ctor","_ctor2enums","_enums2default","gfxTexture2D","gfxTextureCube","ctor2default","enums2ctor","PARAM_COLOR3","className2InspectorName","typeName","valueCtor","assetType","../core/assets/CCTexture2D","../core/value-types","./gfx/texture-2d","283","TiledMapAsset","tmxXmlStr","textureNames","textureSizes","imageLayerTextures","imageLayerTextureNames","tsxFiles","tsxFileNames","284","./cocos2d/actions","./cocos2d/animation","./cocos2d/core","./cocos2d/core/components/CCStudioComponent","./cocos2d/deprecated","./cocos2d/particle","./cocos2d/particle/CCParticleAsset","./cocos2d/tilemap","./cocos2d/tilemap/CCTiledMapAsset","./cocos2d/videoplayer/CCVideoPlayer","./cocos2d/webview/CCWebView","./extensions/ccpool/CCNodePool","./extensions/dragonbones","./extensions/spine","285","EmptyHandle","ATTACHED_ROOT_NAME","ATTACHED_PRE_NAME","limitNode","_tempMat4","AttachUtil","_skeleton","_skeletonNode","_skeletonComp","_attachedRootNode","_attachedNodeArray","_boneIndexToNode","skeletonComp","_prepareAttachNode","armature","isCached","isAnimationCached","_frameCache","enableCacheAttachedInfo","_buildBoneAttachedNode","bone","boneIndex","boneNodeName","boneNode","_buildBoneRelation","_bone","_boneIndex","getAttachedRootNode","getAttachedNodes","boneName","nodeArray","_rebuildNodeArray","findMap","oldNodeArray","_toRemove","_sortNodeArray","_getNodeByBoneIndex","destroyAttachedNodes","markTree","delName","generateAttachedNodes","targetNodes","bones","boneData","buildBoneTree","parentBoneNode","targetNode","destroyAllAttachedNodes","generateAllAttachedNodes","parentIndex","_hasAttachedNode","attachedRootNode","_associateAttachedNode","_syncAttachedNode","rootMatrix","boneInfos","_curFrame","mulMat","matrixHandle","nodeMat","worldX","worldY","nodeArrayDirty","../../cocos2d/core/renderer/render-flow","../../cocos2d/core/value-types/mat4","286","TrackEntryListeners","spine","SkeletonCache","DefaultSkinsEnum","DefaultAnimsEnum"," An interval action is an action that takes place within a certain period of time. These CCActionInterval actions have some interesting properties, like: For example, you can simulate a Ping Pong effect running the action normally and \n * Moves a Node object x,y pixels by modifying its position property. \n * Executes an action in reverse order, from time=duration to time=0 \n * Overrides the target of an action so that it always runs on the target \n * ATTENTION: USE cc.director INSTEAD OF cc.Director. \n * cc.director also synchronizes timers with the refresh rate of the display. \n * 注意:用 cc.director 代替 cc.Director。 \n * cc.director 也同步定时器与显示器的刷新速率。\n *
\n * Possible actions:
\n * - An action with a duration of 0 seconds.
\n * - An action with a duration of 35.5 seconds.\n *\n * Infinite time actions are valid\n * !#zh 有限时间动作,这种动作拥有时长 duration 属性。\n * @class FiniteTimeAction\n * @extends Action\n */\ncc.FiniteTimeAction = cc.Class({\n name: 'cc.FiniteTimeAction',\n extends: cc.Action,\n\n ctor:function () {\n //! duration in seconds\n this._duration = 0;\n },\n\n /**\n * !#en get duration of the action. (seconds).\n * !#zh 获取动作以秒为单位的持续时间。\n * @method getDuration\n * @return {Number}\n */\n getDuration:function () {\n return this._duration * (this._timesForRepeat || 1);\n },\n\n /**\n * !#en set duration of the action. (seconds).\n * !#zh 设置动作以秒为单位的持续时间。\n * @method setDuration\n * @param {Number} duration\n */\n setDuration:function (duration) {\n this._duration = duration;\n },\n\n /**\n * !#en\n * Returns a reversed action.
\n * For example:
\n * - The action will be x coordinates of 0 move to 100.
\n * - The reversed action will be x of 100 move to 0.\n * - Will be rewritten\n * !#zh 返回一个新的动作,执行与原动作完全相反的动作。\n * @method reverse\n * @return {Null}\n */\n reverse:function () {\n cc.logID(1008);\n return null;\n },\n\n /**\n * !#en\n * to copy object with deep copy.\n * returns a clone of action.\n * !#zh 返回一个克隆的动作。\n * @method clone\n * @return {FiniteTimeAction}\n */\n clone:function () {\n return new cc.FiniteTimeAction();\n }\n});\n\n/**\n * @module cc\n */\n\n/*\n * Changes the speed of an action, making it take longer (speed > 1)\n * or less (speed < 1) time.
\n * Useful to simulate 'slow motion' or 'fast forward' effect.\n *\n * @warning This action can't be Sequenceable because it is not an cc.IntervalAction\n * @class Speed\n * @extends Action\n *\n * @param {ActionInterval} action\n * @param {Number} speed\n */\ncc.Speed = cc.Class({\n name: 'cc.Speed',\n extends: cc.Action,\n\n ctor:function (action, speed) {\n this._speed = 0;\n this._innerAction = null;\n\n\t\taction && this.initWithAction(action, speed);\n },\n\n /*\n * Gets the current running speed.
\n * Will get a percentage number, compared to the original speed.\n *\n * @method getSpeed\n * @return {Number}\n */\n getSpeed:function () {\n return this._speed;\n },\n\n /*\n * alter the speed of the inner function in runtime.\n * @method setSpeed\n * @param {Number} speed\n */\n setSpeed:function (speed) {\n this._speed = speed;\n },\n\n /*\n * initializes the action.\n * @method initWithAction\n * @param {ActionInterval} action\n * @param {Number} speed\n * @return {Boolean}\n */\n initWithAction:function (action, speed) {\n if (!action) {\n cc.errorID(1021);\n return false;\n }\n\n this._innerAction = action;\n this._speed = speed;\n return true;\n },\n\n clone:function () {\n var action = new cc.Speed();\n action.initWithAction(this._innerAction.clone(), this._speed);\n return action;\n },\n\n startWithTarget:function (target) {\n cc.Action.prototype.startWithTarget.call(this, target);\n this._innerAction.startWithTarget(target);\n },\n\n stop:function () {\n this._innerAction.stop();\n cc.Action.prototype.stop.call(this);\n },\n\n step:function (dt) {\n this._innerAction.step(dt * this._speed);\n },\n\n isDone:function () {\n return this._innerAction.isDone();\n },\n\n reverse:function () {\n return new cc.Speed(this._innerAction.reverse(), this._speed);\n },\n\n /*\n * Set inner Action.\n * @method setInnerAction\n * @param {ActionInterval} action\n */\n setInnerAction:function (action) {\n if (this._innerAction !== action) {\n this._innerAction = action;\n }\n },\n\n /*\n * Get inner Action.\n * @method getInnerAction\n * @return {ActionInterval}\n */\n getInnerAction:function () {\n return this._innerAction;\n }\n});\n\n/**\n * @module cc\n */\n\n/**\n * !#en\n * Creates the speed action which changes the speed of an action, making it take longer (speed > 1)\n * or less (speed < 1) time.
\n * Useful to simulate 'slow motion' or 'fast forward' effect.\n * !#zh 修改目标动作的速率。\n * @warning This action can't be Sequenceable because it is not an cc.IntervalAction\n *\n * @method speed\n * @param {ActionInterval} action\n * @param {Number} speed\n * @return {Action}\n * @example\n * // change the target action speed;\n * var action = cc.scaleTo(0.2, 1, 0.6);\n * var newAction = cc.speed(action, 0.5);\n */\ncc.speed = function (action, speed) {\n return new cc.Speed(action, speed);\n};\n\n/*\n * cc.Follow is a follow action which makes its target follows another node.\n *\n * @example\n * //example\n * //Instead of using cc.Camera as a \"follower\", use this action instead.\n * layer.runAction(cc.follow(hero));\n *\n * @property {Number} leftBoundary - world leftBoundary.\n * @property {Number} rightBoundary - world rightBoundary.\n * @property {Number} topBoundary - world topBoundary.\n * @property {Number} bottomBoundary - world bottomBoundary.\n *\n * @param {cc.Node} followedNode\n * @param {Rect} rect\n * @example\n * // creates the action with a set boundary\n * var followAction = new cc.Follow(node, cc.rect(0, 0, s.width * 2 - 100, s.height));\n * this.runAction(followAction);\n *\n * // creates the action with no boundary set\n * var followAction = new cc.Follow(node);\n * this.runAction(followAction);\n *\n * @class\n * @extends Action\n */\ncc.Follow = cc.Class({\n name: 'cc.Follow',\n extends: cc.Action,\n\n\t/*\n * Constructor function, override it to extend the construction behavior, remember to call \"this._super()\" in the extended \"ctor\" function.
\n\t * creates the action with a set boundary.
\n\t * creates the action with no boundary set.\n * @param {cc.Node} followedNode\n * @param {Rect} rect\n\t */\n ctor:function (followedNode, rect) {\n // node to follow\n this._followedNode = null;\n // whether camera should be limited to certain area\n this._boundarySet = false;\n // if screen size is bigger than the boundary - update not needed\n this._boundaryFullyCovered = false;\n // fast access to the screen dimensions\n this._halfScreenSize = null;\n this._fullScreenSize = null;\n\n this.leftBoundary = 0.0;\n this.rightBoundary = 0.0;\n this.topBoundary = 0.0;\n this.bottomBoundary = 0.0;\n this._worldRect = cc.rect(0, 0, 0, 0);\n\n\t\tif(followedNode)\n\t\t\trect ? this.initWithTarget(followedNode, rect)\n\t\t\t\t : this.initWithTarget(followedNode);\n },\n\n clone:function () {\n var action = new cc.Follow();\n var locRect = this._worldRect;\n var rect = new cc.Rect(locRect.x, locRect.y, locRect.width, locRect.height);\n action.initWithTarget(this._followedNode, rect);\n return action;\n },\n\n /*\n * Get whether camera should be limited to certain area.\n *\n * @return {Boolean}\n */\n isBoundarySet:function () {\n return this._boundarySet;\n },\n\n /*\n * alter behavior - turn on/off boundary.\n *\n * @param {Boolean} value\n */\n setBoundarySet:function (value) {\n this._boundarySet = value;\n },\n\n /*\n * alter behavior - turn on/off boundary.\n *\n * @param {Boolean} value\n * @deprecated since v2.4.6 , cc.Follow.setBoudarySet is deprecated, please use cc.Follow.setBoundarySet.\n */\n setBoudarySet:function (value) {\n this.setBoundarySet(value);\n },\n\n /*\n * initializes the action with a set boundary.\n *\n * @param {cc.Node} followedNode\n * @param {Rect} [rect=]\n * @return {Boolean}\n */\n initWithTarget:function (followedNode, rect) {\n if (!followedNode) {\n cc.errorID(1022);\n return false;\n }\n\n var _this = this;\n rect = rect || cc.rect(0, 0, 0, 0);\n _this._followedNode = followedNode;\n _this._worldRect = rect;\n\n _this._boundarySet = !(rect.width === 0 && rect.height === 0);\n\n _this._boundaryFullyCovered = false;\n\n var winSize = cc.winSize;\n _this._fullScreenSize = cc.v2(winSize.width, winSize.height);\n _this._halfScreenSize = _this._fullScreenSize.mul(0.5);\n\n if (_this._boundarySet) {\n _this.leftBoundary = -((rect.x + rect.width) - _this._fullScreenSize.x);\n _this.rightBoundary = -rect.x;\n _this.topBoundary = -rect.y;\n _this.bottomBoundary = -((rect.y + rect.height) - _this._fullScreenSize.y);\n\n if (_this.rightBoundary < _this.leftBoundary) {\n // screen width is larger than world's boundary width\n //set both in the middle of the world\n _this.rightBoundary = _this.leftBoundary = (_this.leftBoundary + _this.rightBoundary) / 2;\n }\n if (_this.topBoundary < _this.bottomBoundary) {\n // screen width is larger than world's boundary width\n //set both in the middle of the world\n _this.topBoundary = _this.bottomBoundary = (_this.topBoundary + _this.bottomBoundary) / 2;\n }\n\n if ((_this.topBoundary === _this.bottomBoundary) && (_this.leftBoundary === _this.rightBoundary))\n _this._boundaryFullyCovered = true;\n }\n return true;\n },\n\n step:function (dt) {\n var targetWorldPos = this.target.convertToWorldSpaceAR(cc.Vec2.ZERO);\n var followedWorldPos = this._followedNode.convertToWorldSpaceAR(cc.Vec2.ZERO);\n // compute the offset between followed and target node\n var delta = targetWorldPos.sub(followedWorldPos);\n var tempPos = this.target.parent.convertToNodeSpaceAR(delta.add(this._halfScreenSize));\n\n if (this._boundarySet) {\n // whole map fits inside a single screen, no need to modify the position - unless map boundaries are increased\n if (this._boundaryFullyCovered)\n return;\n\n\t this.target.setPosition(misc.clampf(tempPos.x, this.leftBoundary, this.rightBoundary), misc.clampf(tempPos.y, this.bottomBoundary, this.topBoundary));\n } else {\n this.target.setPosition(tempPos.x, tempPos.y);\n }\n },\n\n isDone:function () {\n return ( !this._followedNode.activeInHierarchy );\n },\n\n stop:function () {\n this.target = null;\n cc.Action.prototype.stop.call(this);\n }\n});\n\n/**\n * !#en Create a follow action which makes its target follows another node.\n * !#zh 追踪目标节点的位置。\n * @method follow\n * @param {Node} followedNode\n * @param {Rect} rect\n * @return {Action|Null} returns the cc.Follow object on success\n * @example\n * // example\n * // creates the action with a set boundary\n * var followAction = cc.follow(targetNode, cc.rect(0, 0, screenWidth * 2 - 100, screenHeight));\n * node.runAction(followAction);\n *\n * // creates the action with no boundary set\n * var followAction = cc.follow(targetNode);\n * node.runAction(followAction);\n */\ncc.follow = function (followedNode, rect) {\n return new cc.Follow(followedNode, rect);\n};\n","/****************************************************************************\n Copyright (c) 2008 Radu Gruian\n Copyright (c) 2008-2010 Ricardo Quesada\n Copyright (c) 2011 Vit Valentin\n Copyright (c) 2011-2012 cocos2d-x.org\n Copyright (c) 2013-2016 Chukong Technologies Inc.\n Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n\n Orignal code by Radu Gruian: http://www.codeproject.com/Articles/30838/Overhauser-Catmull-Rom-Splines-for-Camera-Animatio.So\n\n Adapted to cocos2d-x by Vit Valentin\n\n Adapted from cocos2d-x to cocos2d-iphone by Ricardo Quesada\n ****************************************************************************/\n\n/**\n * @module cc\n */\n\n/*\n * Returns the Cardinal Spline position for a given set of control points, tension and time.
\n * CatmullRom Spline formula.
\n * s(-ttt + 2tt - t)P1 + s(-ttt + tt)P2 + (2ttt - 3tt + 1)P2 + s(ttt - 2tt + t)P3 + (-2ttt + 3tt)P3 + s(ttt - tt)P4\n *\n * @method cardinalSplineAt\n * @param {Vec2} p0\n * @param {Vec2} p1\n * @param {Vec2} p2\n * @param {Vec2} p3\n * @param {Number} tension\n * @param {Number} t\n * @return {Vec2}\n */\nfunction cardinalSplineAt (p0, p1, p2, p3, tension, t) {\n var t2 = t * t;\n var t3 = t2 * t;\n\n /*\n * Formula: s(-ttt + 2tt - t)P1 + s(-ttt + tt)P2 + (2ttt - 3tt + 1)P2 + s(ttt - 2tt + t)P3 + (-2ttt + 3tt)P3 + s(ttt - tt)P4\n */\n var s = (1 - tension) / 2;\n\n var b1 = s * ((-t3 + (2 * t2)) - t); // s(-t3 + 2 t2 - t)P1\n var b2 = s * (-t3 + t2) + (2 * t3 - 3 * t2 + 1); // s(-t3 + t2)P2 + (2 t3 - 3 t2 + 1)P2\n var b3 = s * (t3 - 2 * t2 + t) + (-2 * t3 + 3 * t2); // s(t3 - 2 t2 + t)P3 + (-2 t3 + 3 t2)P3\n var b4 = s * (t3 - t2); // s(t3 - t2)P4\n\n var x = (p0.x * b1 + p1.x * b2 + p2.x * b3 + p3.x * b4);\n var y = (p0.y * b1 + p1.y * b2 + p2.y * b3 + p3.y * b4);\n return cc.v2(x, y);\n};\n\n/*\n * returns a point from the array\n * @method getControlPointAt\n * @param {Array} controlPoints\n * @param {Number} pos\n * @return {Array}\n */\nfunction getControlPointAt (controlPoints, pos) {\n var p = Math.min(controlPoints.length - 1, Math.max(pos, 0));\n return controlPoints[p];\n};\n\nfunction reverseControlPoints (controlPoints) {\n var newArray = [];\n for (var i = controlPoints.length - 1; i >= 0; i--) {\n newArray.push(cc.v2(controlPoints[i].x, controlPoints[i].y));\n }\n return newArray;\n}\n\nfunction cloneControlPoints (controlPoints) {\n var newArray = [];\n for (var i = 0; i < controlPoints.length; i++)\n newArray.push(cc.v2(controlPoints[i].x, controlPoints[i].y));\n return newArray;\n}\n\n\n/*\n * Cardinal Spline path. http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Cardinal_spline\n * Absolute coordinates.\n *\n * @class CardinalSplineTo\n * @extends ActionInterval\n *\n * @param {Number} duration\n * @param {Array} points array of control points\n * @param {Number} tension\n *\n * @example\n * //create a cc.CardinalSplineTo\n * var action1 = cc.cardinalSplineTo(3, array, 0);\n */\ncc.CardinalSplineTo = cc.Class({\n name: 'cc.CardinalSplineTo',\n extends: cc.ActionInterval,\n\n ctor: function (duration, points, tension) {\n /* Array of control points */\n this._points = [];\n this._deltaT = 0;\n this._tension = 0;\n this._previousPosition = null;\n this._accumulatedDiff = null;\n tension !== undefined && cc.CardinalSplineTo.prototype.initWithDuration.call(this, duration, points, tension);\n },\n\n initWithDuration:function (duration, points, tension) {\n if (!points || points.length === 0) {\n cc.errorID(1024);\n return false;\n }\n\n if (cc.ActionInterval.prototype.initWithDuration.call(this, duration)) {\n this.setPoints(points);\n this._tension = tension;\n return true;\n }\n return false;\n },\n\n clone:function () {\n var action = new cc.CardinalSplineTo();\n action.initWithDuration(this._duration, cloneControlPoints(this._points), this._tension);\n return action;\n },\n\n startWithTarget:function (target) {\n cc.ActionInterval.prototype.startWithTarget.call(this, target);\n // Issue #1441 from cocos2d-iphone\n this._deltaT = 1 / (this._points.length - 1);\n this._previousPosition = cc.v2(this.target.x, this.target.y);\n this._accumulatedDiff = cc.v2(0, 0);\n },\n\n update:function (dt) {\n dt = this._computeEaseTime(dt);\n var p, lt;\n var ps = this._points;\n // eg.\n // p..p..p..p..p..p..p\n // 1..2..3..4..5..6..7\n // want p to be 1, 2, 3, 4, 5, 6\n if (dt === 1) {\n p = ps.length - 1;\n lt = 1;\n } else {\n var locDT = this._deltaT;\n p = 0 | (dt / locDT);\n lt = (dt - locDT * p) / locDT;\n }\n\n var newPos = cardinalSplineAt(\n getControlPointAt(ps, p - 1),\n getControlPointAt(ps, p - 0),\n getControlPointAt(ps, p + 1),\n getControlPointAt(ps, p + 2),\n this._tension, lt);\n\n if (cc.macro.ENABLE_STACKABLE_ACTIONS) {\n var tempX, tempY;\n tempX = this.target.x - this._previousPosition.x;\n tempY = this.target.y - this._previousPosition.y;\n if (tempX !== 0 || tempY !== 0) {\n var locAccDiff = this._accumulatedDiff;\n tempX = locAccDiff.x + tempX;\n tempY = locAccDiff.y + tempY;\n locAccDiff.x = tempX;\n locAccDiff.y = tempY;\n newPos.x += tempX;\n newPos.y += tempY;\n }\n }\n this.updatePosition(newPos);\n },\n\n reverse:function () {\n var reversePoints = reverseControlPoints(this._points);\n return cc.cardinalSplineTo(this._duration, reversePoints, this._tension);\n },\n\n /*\n * update position of target\n * @method updatePosition\n * @param {Vec2} newPos\n */\n updatePosition:function (newPos) {\n this.target.setPosition(newPos);\n this._previousPosition = newPos;\n },\n\n /*\n * Points getter\n * @method getPoints\n * @return {Array}\n */\n getPoints:function () {\n return this._points;\n },\n\n /**\n * Points setter\n * @method setPoints\n * @param {Array} points\n */\n setPoints:function (points) {\n this._points = points;\n }\n});\n\n/**\n * !#en Creates an action with a Cardinal Spline array of points and tension.\n * !#zh 按基数样条曲线轨迹移动到目标位置。\n * @method cardinalSplineTo\n * @param {Number} duration\n * @param {Array} points array of control points\n * @param {Number} tension\n * @return {ActionInterval}\n *\n * @example\n * //create a cc.CardinalSplineTo\n * var action1 = cc.cardinalSplineTo(3, array, 0);\n */\ncc.cardinalSplineTo = function (duration, points, tension) {\n return new cc.CardinalSplineTo(duration, points, tension);\n};\n\n/*\n * Cardinal Spline path. http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Cardinal_spline\n * Relative coordinates.\n *\n * @class CardinalSplineBy\n * @extends CardinalSplineTo\n *\n * @param {Number} duration\n * @param {Array} points\n * @param {Number} tension\n *\n * @example\n * //create a cc.CardinalSplineBy\n * var action1 = cc.cardinalSplineBy(3, array, 0);\n */\ncc.CardinalSplineBy = cc.Class({\n name: 'cc.CardinalSplineBy',\n extends: cc.CardinalSplineTo,\n\n ctor:function (duration, points, tension) {\n this._startPosition = cc.v2(0, 0);\n tension !== undefined && this.initWithDuration(duration, points, tension);\n },\n\n startWithTarget:function (target) {\n cc.CardinalSplineTo.prototype.startWithTarget.call(this, target);\n this._startPosition.x = target.x;\n this._startPosition.y = target.y;\n },\n\n reverse:function () {\n var copyConfig = this._points.slice();\n var current;\n //\n // convert \"absolutes\" to \"diffs\"\n //\n var p = copyConfig[0];\n for (var i = 1; i < copyConfig.length; ++i) {\n current = copyConfig[i];\n copyConfig[i] = current.sub(p);\n p = current;\n }\n\n // convert to \"diffs\" to \"reverse absolute\"\n var reverseArray = reverseControlPoints(copyConfig);\n\n // 1st element (which should be 0,0) should be here too\n p = reverseArray[ reverseArray.length - 1 ];\n reverseArray.pop();\n\n p.x = -p.x;\n p.y = -p.y;\n\n reverseArray.unshift(p);\n for (var i = 1; i < reverseArray.length; ++i) {\n current = reverseArray[i];\n current.x = -current.x;\n current.y = -current.y;\n current.x += p.x;\n current.y += p.y;\n reverseArray[i] = current;\n p = current;\n }\n return cc.cardinalSplineBy(this._duration, reverseArray, this._tension);\n },\n\n /**\n * update position of target\n * @method updatePosition\n * @param {Vec2} newPos\n */\n updatePosition:function (newPos) {\n var pos = this._startPosition;\n var posX = newPos.x + pos.x;\n var posY = newPos.y + pos.y;\n this._previousPosition.x = posX;\n this._previousPosition.y = posY;\n this.target.setPosition(posX, posY);\n },\n\n clone:function () {\n var a = new cc.CardinalSplineBy();\n a.initWithDuration(this._duration, cloneControlPoints(this._points), this._tension);\n return a;\n }\n});\n\n/**\n * !#en Creates an action with a Cardinal Spline array of points and tension.\n * !#zh 按基数样条曲线轨迹移动指定的距离。\n * @method cardinalSplineBy\n * @param {Number} duration\n * @param {Array} points\n * @param {Number} tension\n *\n * @return {ActionInterval}\n */\ncc.cardinalSplineBy = function (duration, points, tension) {\n return new cc.CardinalSplineBy(duration, points, tension);\n};\n\n/*\n * An action that moves the target with a CatmullRom curve to a destination point.
\n * A Catmull Rom is a Cardinal Spline with a tension of 0.5.
\n * http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Catmull.E2.80.93Rom_spline\n * Absolute coordinates.\n *\n * @class CatmullRomTo\n * @extends CardinalSplineTo\n *\n * @param {Number} dt\n * @param {Array} points\n *\n * @example\n * var action1 = cc.catmullRomTo(3, array);\n */\ncc.CatmullRomTo = cc.Class({\n name: 'cc.CatmullRomTo',\n extends: cc.CardinalSplineTo,\n\n ctor: function(dt, points) {\n points && this.initWithDuration(dt, points);\n },\n\n initWithDuration:function (dt, points) {\n return cc.CardinalSplineTo.prototype.initWithDuration.call(this, dt, points, 0.5);\n },\n\n clone:function () {\n var action = new cc.CatmullRomTo();\n action.initWithDuration(this._duration, cloneControlPoints(this._points));\n return action;\n }\n});\n\n/**\n * !#en Creates an action with a Cardinal Spline array of points and tension.\n * !#zh 按 Catmull Rom 样条曲线轨迹移动到目标位置。\n * @method catmullRomTo\n * @param {Number} dt\n * @param {Array} points\n * @return {ActionInterval}\n *\n * @example\n * var action1 = cc.catmullRomTo(3, array);\n */\ncc.catmullRomTo = function (dt, points) {\n return new cc.CatmullRomTo(dt, points);\n};\n\n/*\n * An action that moves the target with a CatmullRom curve by a certain distance.
\n * A Catmull Rom is a Cardinal Spline with a tension of 0.5.
\n * http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Catmull.E2.80.93Rom_spline\n * Relative coordinates.\n *\n * @class CatmullRomBy\n * @extends CardinalSplineBy\n *\n * @param {Number} dt\n * @param {Array} points\n *\n * @example\n * var action1 = cc.catmullRomBy(3, array);\n */\ncc.CatmullRomBy = cc.Class({\n name: 'cc.CatmullRomBy',\n extends: cc.CardinalSplineBy,\n\n ctor: function(dt, points) {\n points && this.initWithDuration(dt, points);\n },\n\n initWithDuration:function (dt, points) {\n return cc.CardinalSplineTo.prototype.initWithDuration.call(this, dt, points, 0.5);\n },\n\n clone:function () {\n var action = new cc.CatmullRomBy();\n action.initWithDuration(this._duration, cloneControlPoints(this._points));\n return action;\n }\n});\n\n/**\n * !#en Creates an action with a Cardinal Spline array of points and tension.\n * !#zh 按 Catmull Rom 样条曲线轨迹移动指定的距离。\n * @method catmullRomBy\n * @param {Number} dt\n * @param {Array} points\n * @return {ActionInterval}\n * @example\n * var action1 = cc.catmullRomBy(3, array);\n */\ncc.catmullRomBy = function (dt, points) {\n return new cc.CatmullRomBy(dt, points);\n};\n","/****************************************************************************\n Copyright (c) 2008-2010 Ricardo Quesada\n Copyright (c) 2011-2012 cocos2d-x.org\n Copyright (c) 2013-2016 Chukong Technologies Inc.\n Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n/**\n * @module cc\n */\n\n/**\n * !#en\n * Creates the action easing object with the rate parameter.
\n * From slow to fast.\n * !#zh 创建 easeIn 缓动对象,由慢到快。\n * @method easeIn\n * @param {Number} rate\n * @return {Object}\n * @example\n * action.easing(cc.easeIn(3.0));\n */\ncc.easeIn = function (rate) {\n return {\n _rate: rate,\n easing: function (dt) {\n return Math.pow(dt, this._rate);\n },\n reverse: function(){\n return cc.easeIn(1 / this._rate);\n }\n };\n};\n\n/**\n * !#en\n * Creates the action easing object with the rate parameter.
\n * From fast to slow.\n * !#zh 创建 easeOut 缓动对象,由快到慢。\n * @method easeOut\n * @param {Number} rate\n * @return {Object}\n * @example\n * action.easing(cc.easeOut(3.0));\n */\ncc.easeOut = function (rate) {\n return {\n _rate: rate,\n easing: function (dt) {\n return Math.pow(dt, 1 / this._rate);\n },\n reverse: function(){\n return cc.easeOut(1 / this._rate);\n }\n };\n};\n\n/**\n * !#en\n * Creates the action easing object with the rate parameter.
\n * Slow to fast then to slow.\n * !#zh 创建 easeInOut 缓动对象,慢到快,然后慢。\n * @method easeInOut\n * @param {Number} rate\n * @return {Object}\n *\n * @example\n * action.easing(cc.easeInOut(3.0));\n */\ncc.easeInOut = function (rate) {\n return {\n _rate: rate,\n easing: function (dt) {\n dt *= 2;\n if (dt < 1)\n return 0.5 * Math.pow(dt, this._rate);\n else\n return 1.0 - 0.5 * Math.pow(2 - dt, this._rate);\n },\n reverse: function(){\n return cc.easeInOut(this._rate);\n }\n };\n};\n\n/**\n * !#en\n * Creates the action easing object with the rate parameter.
\n * Reference easeInExpo:
\n * http://www.zhihu.com/question/21981571/answer/19925418\n * !#zh\n * 创建 easeExponentialIn 缓动对象。
\n * EaseExponentialIn 是按指数函数缓动进入的动作。
\n * 参考 easeInExpo:http://www.zhihu.com/question/21981571/answer/19925418\n * @method easeExponentialIn\n * @return {Object}\n * @example\n * action.easing(cc.easeExponentialIn());\n */\nvar _easeExponentialInObj = {\n easing: function(dt){\n return dt === 0 ? 0 : Math.pow(2, 10 * (dt - 1));\n },\n reverse: function(){\n return _easeExponentialOutObj;\n }\n};\ncc.easeExponentialIn = function(){\n return _easeExponentialInObj;\n};\n\n/**\n * !#en\n * Creates the action easing object.
\n * Reference easeOutExpo:
\n * http://www.zhihu.com/question/21981571/answer/19925418\n * !#zh\n * 创建 easeExponentialOut 缓动对象。
\n * EaseExponentialOut 是按指数函数缓动退出的动作。
\n * 参考 easeOutExpo:http://www.zhihu.com/question/21981571/answer/19925418\n * @method easeExponentialOut\n * @return {Object}\n * @example\n * action.easing(cc.easeExponentialOut());\n */\nvar _easeExponentialOutObj = {\n easing: function(dt){\n return dt === 1 ? 1 : (-(Math.pow(2, -10 * dt)) + 1);\n },\n reverse: function(){\n return _easeExponentialInObj;\n }\n};\ncc.easeExponentialOut = function(){\n return _easeExponentialOutObj;\n};\n\n/**\n * !#en\n * Creates an EaseExponentialInOut action easing object.
\n * Reference easeInOutExpo:
\n * http://www.zhihu.com/question/21981571/answer/19925418\n * !#zh\n * 创建 easeExponentialInOut 缓动对象。
\n * EaseExponentialInOut 是按指数函数缓动进入并退出的动作。
\n * 参考 easeInOutExpo:http://www.zhihu.com/question/21981571/answer/19925418\n * @method easeExponentialInOut\n * @return {Object}\n * @example\n * action.easing(cc.easeExponentialInOut());\n */\nvar _easeExponentialInOutObj = {\n easing: function(dt){\n if( dt !== 1 && dt !== 0) {\n dt *= 2;\n if (dt < 1)\n return 0.5 * Math.pow(2, 10 * (dt - 1));\n else\n return 0.5 * (-Math.pow(2, -10 * (dt - 1)) + 2);\n }\n return dt;\n },\n reverse: function(){\n return _easeExponentialInOutObj;\n }\n};\ncc.easeExponentialInOut = function(){\n return _easeExponentialInOutObj;\n};\n\n/**\n * !#en\n * Creates an EaseSineIn action.
\n * Reference easeInSine:
\n * http://www.zhihu.com/question/21981571/answer/19925418\n * !#zh\n * 创建 EaseSineIn 缓动对象。
\n * EaseSineIn 是按正弦函数缓动进入的动作。
\n * 参考 easeInSine:http://www.zhihu.com/question/21981571/answer/19925418\n * @method easeSineIn\n * @return {Object}\n * @example\n * action.easing(cc.easeSineIn());\n */\nvar _easeSineInObj = {\n easing: function(dt){\n return (dt===0 || dt===1) ? dt : -1 * Math.cos(dt * Math.PI / 2) + 1;\n },\n reverse: function(){\n return _easeSineOutObj;\n }\n};\ncc.easeSineIn = function(){\n return _easeSineInObj;\n};\n\n/**\n * !#en\n * Creates an EaseSineOut action easing object.
\n * Reference easeOutSine:
\n * http://www.zhihu.com/question/21981571/answer/19925418\n * !#zh\n * 创建 EaseSineOut 缓动对象。
\n * EaseSineIn 是按正弦函数缓动退出的动作。
\n * 参考 easeOutSine:http://www.zhihu.com/question/21981571/answer/19925418\n * @method easeSineOut\n * @return {Object}\n * @example\n * action.easing(cc.easeSineOut());\n */\nvar _easeSineOutObj = {\n easing: function(dt){\n return (dt===0 || dt===1) ? dt : Math.sin(dt * Math.PI / 2);\n },\n reverse: function(){\n return _easeSineInObj;\n }\n};\ncc.easeSineOut = function(){\n return _easeSineOutObj;\n};\n\n/**\n * !#en\n * Creates the action easing object.
\n * Reference easeInOutSine:
\n * http://www.zhihu.com/question/21981571/answer/19925418\n * !#zh\n * 创建 easeSineInOut 缓动对象。
\n * EaseSineIn 是按正弦函数缓动进入并退出的动作。
\n * 参考 easeInOutSine:http://www.zhihu.com/question/21981571/answer/19925418\n * @method easeSineInOut\n * @return {Object}\n * @example\n * action.easing(cc.easeSineInOut());\n */\nvar _easeSineInOutObj = {\n easing: function(dt){\n return (dt === 0 || dt === 1) ? dt : -0.5 * (Math.cos(Math.PI * dt) - 1);\n },\n reverse: function(){\n return _easeSineInOutObj;\n }\n};\ncc.easeSineInOut = function(){\n return _easeSineInOutObj;\n};\n\n/**\n * @module cc\n */\n\n/**\n * !#en\n * Creates the action easing object with the period in radians (default is 0.3).
\n * Reference easeInElastic:
\n * http://www.zhihu.com/question/21981571/answer/19925418\n * !#zh\n * 创建 easeElasticIn 缓动对象。
\n * EaseElasticIn 是按弹性曲线缓动进入的动作。
\n * 参数 easeInElastic:http://www.zhihu.com/question/21981571/answer/19925418\n * @method easeElasticIn\n * @param {Number} period\n * @return {Object}\n * @example\n * // example\n * action.easing(cc.easeElasticIn(3.0));\n */\n//default ease elastic in object (period = 0.3)\nvar _easeElasticInObj = {\n easing:function(dt){\n if (dt === 0 || dt === 1)\n return dt;\n dt = dt - 1;\n return -Math.pow(2, 10 * dt) * Math.sin((dt - (0.3 / 4)) * Math.PI * 2 / 0.3);\n },\n reverse:function(){\n return _easeElasticOutObj;\n }\n };\ncc.easeElasticIn = function (period) {\n if(period && period !== 0.3){\n return {\n _period: period,\n easing: function (dt) {\n if (dt === 0 || dt === 1)\n return dt;\n dt = dt - 1;\n return -Math.pow(2, 10 * dt) * Math.sin((dt - (this._period / 4)) * Math.PI * 2 / this._period);\n },\n reverse:function () {\n return cc.easeElasticOut(this._period);\n }\n };\n }\n return _easeElasticInObj;\n};\n\n/**\n * !#en\n * Creates the action easing object with the period in radians (default is 0.3).
\n * Reference easeOutElastic:
\n * http://www.zhihu.com/question/21981571/answer/19925418\n * !#zh\n * 创建 easeElasticOut 缓动对象。
\n * EaseElasticOut 是按弹性曲线缓动退出的动作。
\n * 参考 easeOutElastic:http://www.zhihu.com/question/21981571/answer/19925418\n * @method easeElasticOut\n * @param {Number} period\n * @return {Object}\n * @example\n * // example\n * action.easing(cc.easeElasticOut(3.0));\n */\n//default ease elastic out object (period = 0.3)\nvar _easeElasticOutObj = {\n easing: function (dt) {\n return (dt === 0 || dt === 1) ? dt : Math.pow(2, -10 * dt) * Math.sin((dt - (0.3 / 4)) * Math.PI * 2 / 0.3) + 1;\n },\n reverse:function(){\n return _easeElasticInObj;\n }\n};\ncc.easeElasticOut = function (period) {\n if(period && period !== 0.3){\n return {\n _period: period,\n easing: function (dt) {\n return (dt === 0 || dt === 1) ? dt : Math.pow(2, -10 * dt) * Math.sin((dt - (this._period / 4)) * Math.PI * 2 / this._period) + 1;\n },\n reverse:function(){\n return cc.easeElasticIn(this._period);\n }\n };\n }\n return _easeElasticOutObj;\n};\n\n/**\n * !#en\n * Creates the action easing object with the period in radians (default is 0.3).
\n * Reference easeInOutElastic:
\n * http://www.zhihu.com/question/21981571/answer/19925418\n * !#zh\n * 创建 easeElasticInOut 缓动对象。
\n * EaseElasticInOut 是按弹性曲线缓动进入并退出的动作。
\n * 参考 easeInOutElastic:http://www.zhihu.com/question/21981571/answer/19925418\n * @method easeElasticInOut\n * @param {Number} period\n * @return {Object}\n * @example\n * // example\n * action.easing(cc.easeElasticInOut(3.0));\n */\ncc.easeElasticInOut = function (period) {\n period = period || 0.3;\n return {\n _period: period,\n easing: function (dt) {\n var newT = 0;\n var locPeriod = this._period;\n if (dt === 0 || dt === 1) {\n newT = dt;\n } else {\n dt = dt * 2;\n if (!locPeriod)\n locPeriod = this._period = 0.3 * 1.5;\n var s = locPeriod / 4;\n dt = dt - 1;\n if (dt < 0)\n newT = -0.5 * Math.pow(2, 10 * dt) * Math.sin((dt - s) * Math.PI * 2 / locPeriod);\n else\n newT = Math.pow(2, -10 * dt) * Math.sin((dt - s) * Math.PI * 2 / locPeriod) * 0.5 + 1;\n }\n return newT;\n },\n reverse: function(){\n return cc.easeElasticInOut(this._period);\n }\n };\n};\n\n/**\n * @module cc\n */\n\nfunction _bounceTime (time1) {\n if (time1 < 1 / 2.75) {\n return 7.5625 * time1 * time1;\n } else if (time1 < 2 / 2.75) {\n time1 -= 1.5 / 2.75;\n return 7.5625 * time1 * time1 + 0.75;\n } else if (time1 < 2.5 / 2.75) {\n time1 -= 2.25 / 2.75;\n return 7.5625 * time1 * time1 + 0.9375;\n }\n\n time1 -= 2.625 / 2.75;\n return 7.5625 * time1 * time1 + 0.984375;\n};\n\nvar _easeBounceInObj = {\n easing: function(dt){\n return 1 - _bounceTime(1 - dt);\n },\n reverse: function(){\n return _easeBounceOutObj;\n }\n};\n\n/**\n * !#en\n * Creates the action easing object.
\n * Eased bounce effect at the beginning.\n * !#zh\n * 创建 easeBounceIn 缓动对象。
\n * EaseBounceIn 是按弹跳动作缓动进入的动作。\n * @method easeBounceIn\n * @return {Object}\n * @example\n * // example\n * action.easing(cc.easeBounceIn());\n */\ncc.easeBounceIn = function(){\n return _easeBounceInObj;\n};\n\n/**\n * !#en\n * Creates the action easing object.
\n * Eased bounce effect at the ending.\n * !#zh\n * 创建 easeBounceOut 缓动对象。
\n * EaseBounceOut 是按弹跳动作缓动退出的动作。\n * @method easeBounceOut\n * @return {Object}\n * @example\n * // example\n * action.easing(cc.easeBounceOut());\n */\nvar _easeBounceOutObj = {\n easing: function(dt){\n return _bounceTime(dt);\n },\n reverse:function () {\n return _easeBounceInObj;\n }\n};\ncc.easeBounceOut = function(){\n return _easeBounceOutObj;\n};\n\n/**\n * !#en\n * Creates the action easing object.
\n * Eased bounce effect at the begining and ending.\n * !#zh\n * 创建 easeBounceInOut 缓动对象。
\n * EaseBounceInOut 是按弹跳动作缓动进入并退出的动作。\n * @method easeBounceInOut\n * @return {Object}\n * @example\n * // example\n * action.easing(cc.easeBounceInOut());\n */\nvar _easeBounceInOutObj = {\n easing: function (time1) {\n var newT;\n if (time1 < 0.5) {\n time1 = time1 * 2;\n newT = (1 - _bounceTime(1 - time1)) * 0.5;\n } else {\n newT = _bounceTime(time1 * 2 - 1) * 0.5 + 0.5;\n }\n return newT;\n },\n reverse: function(){\n return _easeBounceInOutObj;\n }\n};\ncc.easeBounceInOut = function(){\n return _easeBounceInOutObj;\n};\n\n/**\n * !#en\n * Creates the action easing object.
\n * In the opposite direction to move slowly, and then accelerated to the right direction.\n * !#zh\n * 创建 easeBackIn 缓动对象。
\n * easeBackIn 是在相反的方向缓慢移动,然后加速到正确的方向。
\n * @method easeBackIn\n * @return {Object}\n * @example\n * // example\n * action.easing(cc.easeBackIn());\n */\nvar _easeBackInObj = {\n easing: function (time1) {\n var overshoot = 1.70158;\n return (time1===0 || time1===1) ? time1 : time1 * time1 * ((overshoot + 1) * time1 - overshoot);\n },\n reverse: function(){\n return _easeBackOutObj;\n }\n};\ncc.easeBackIn = function(){\n return _easeBackInObj;\n};\n\n/**\n * !#en\n * Creates the action easing object.
\n * Fast moving more than the finish, and then slowly back to the finish.\n * !#zh\n * 创建 easeBackOut 缓动对象。
\n * easeBackOut 快速移动超出目标,然后慢慢回到目标点。\n * @method easeBackOut\n * @return {Object}\n * @example\n * // example\n * action.easing(cc.easeBackOut());\n */\nvar _easeBackOutObj = {\n easing: function (time1) {\n if (time1 === 0) {\n return 0;\n }\n var overshoot = 1.70158;\n time1 = time1 - 1;\n return time1 * time1 * ((overshoot + 1) * time1 + overshoot) + 1;\n },\n reverse: function(){\n return _easeBackInObj;\n }\n};\ncc.easeBackOut = function(){\n return _easeBackOutObj;\n};\n\n/**\n * !#en\n * Creates the action easing object.
\n * Begining of cc.EaseBackIn. Ending of cc.EaseBackOut.\n * !#zh\n * 创建 easeBackInOut 缓动对象。
\n * @method easeBackInOut\n * @return {Object}\n * @example\n * // example\n * action.easing(cc.easeBackInOut());\n */\nvar _easeBackInOutObj = {\n easing: function (time1) {\n var overshoot = 1.70158 * 1.525;\n time1 = time1 * 2;\n if (time1 < 1) {\n return (time1 * time1 * ((overshoot + 1) * time1 - overshoot)) / 2;\n } else {\n time1 = time1 - 2;\n return (time1 * time1 * ((overshoot + 1) * time1 + overshoot)) / 2 + 1;\n }\n },\n reverse: function(){\n return _easeBackInOutObj;\n }\n};\ncc.easeBackInOut = function(){\n return _easeBackInOutObj;\n};\n\n/**\n * !#en\n * Creates the action easing object.
\n * Into the 4 reference point.
\n * To calculate the motion curve.\n * !#zh\n * 创建 easeBezierAction 缓动对象。
\n * EaseBezierAction 是按贝塞尔曲线缓动的动作。\n * @method easeBezierAction\n * @param {Number} p0 The first bezier parameter\n * @param {Number} p1 The second bezier parameter\n * @param {Number} p2 The third bezier parameter\n * @param {Number} p3 The fourth bezier parameter\n * @returns {Object}\n * @example\n * // example\n * action.easing(cc.easeBezierAction(0.5, 0.5, 1.0, 1.0));\n */\ncc.easeBezierAction = function(a, b, c, d){\n return {\n easing: function(t){\n return (Math.pow(1-t,3) * a + 3*t*(Math.pow(1-t,2))*b + 3*Math.pow(t,2)*(1-t)*c + Math.pow(t,3)*d);\n },\n reverse: function(){\n return cc.easeBezierAction(d, c, b, a);\n }\n };\n};\n\n/**\n * !#en\n * Creates the action easing object.
\n * Reference easeInQuad:
\n * http://www.zhihu.com/question/21981571/answer/19925418\n * !#zh\n * 创建 easeQuadraticActionIn 缓动对象。
\n * EaseQuadraticIn是按二次函数缓动进入的动作。
\n * 参考 easeInQuad:http://www.zhihu.com/question/21981571/answer/19925418\n * @method easeQuadraticActionIn\n * @returns {Object}\n * @example\n * //example\n * action.easing(cc.easeQuadraticActionIn());\n */\nvar _easeQuadraticActionIn = {\n easing: function(time){\n return Math.pow(time, 2);\n },\n reverse: function(){\n return _easeQuadraticActionIn;\n }\n};\ncc.easeQuadraticActionIn = function(){\n return _easeQuadraticActionIn;\n};\n\n/**\n * !#en\n * Creates the action easing object.
\n * Reference easeOutQuad:
\n * http://www.zhihu.com/question/21981571/answer/19925418\n * !#zh\n * 创建 easeQuadraticActionOut 缓动对象。
\n * EaseQuadraticOut 是按二次函数缓动退出的动作。
\n * 参考 easeOutQuad:http://www.zhihu.com/question/21981571/answer/19925418\n * @method easeQuadraticActionOut\n * @returns {Object}\n * @example\n * //example\n * action.easing(cc.easeQuadraticActionOut());\n */\nvar _easeQuadraticActionOut = {\n easing: function(time){\n return -time*(time-2);\n },\n reverse: function(){\n return _easeQuadraticActionOut;\n }\n};\ncc.easeQuadraticActionOut = function(){\n return _easeQuadraticActionOut;\n};\n\n/**\n * !#en\n * Creates the action easing object.
\n * Reference easeInOutQuad:
\n * http://www.zhihu.com/question/21981571/answer/19925418\n * !#zh\n * 创建 easeQuadraticActionInOut 缓动对象。
\n * EaseQuadraticInOut 是按二次函数缓动进入并退出的动作。
\n * 参考 easeInOutQuad:http://www.zhihu.com/question/21981571/answer/19925418\n * @method easeQuadraticActionInOut\n * @returns {Object}\n * @example\n * //example\n * action.easing(cc.easeQuadraticActionInOut());\n */\nvar _easeQuadraticActionInOut = {\n easing: function(time){\n var resultTime = time;\n time *= 2;\n if(time < 1){\n resultTime = time * time * 0.5;\n }else{\n --time;\n resultTime = -0.5 * ( time * ( time - 2 ) - 1)\n }\n return resultTime;\n },\n reverse: function(){\n return _easeQuadraticActionInOut;\n }\n};\ncc.easeQuadraticActionInOut = function(){\n return _easeQuadraticActionInOut;\n};\n\n/**\n * !#en\n * Creates the action easing object.
\n * Reference easeIntQuart:
\n * http://www.zhihu.com/question/21981571/answer/19925418\n * !#zh\n * 创建 easeQuarticActionIn 缓动对象。
\n * EaseQuarticIn 是按四次函数缓动进入的动作。
\n * 参考 easeIntQuart:http://www.zhihu.com/question/21981571/answer/19925418\n * @method easeQuarticActionIn\n * @returns {Object}\n * @example\n * //example\n * action.easing(cc.easeQuarticActionIn());\n */\nvar _easeQuarticActionIn = {\n easing: function(time){\n return time * time * time * time;\n },\n reverse: function(){\n return _easeQuarticActionIn;\n }\n};\ncc.easeQuarticActionIn = function(){\n return _easeQuarticActionIn;\n};\n\n/**\n * !#en\n * Creates the action easing object.
\n * Reference easeOutQuart:
\n * http://www.zhihu.com/question/21981571/answer/19925418\n * !#zh\n * 创建 easeQuarticActionOut 缓动对象。
\n * EaseQuarticOut 是按四次函数缓动退出的动作。
\n * 参考 easeOutQuart:http://www.zhihu.com/question/21981571/answer/19925418\n * @method easeQuarticActionOut\n * @returns {Object}\n * @example\n * //example\n * action.easing(cc.QuarticActionOut());\n */\nvar _easeQuarticActionOut = {\n easing: function(time){\n time -= 1;\n return -(time * time * time * time - 1);\n },\n reverse: function(){\n return _easeQuarticActionOut;\n }\n};\ncc.easeQuarticActionOut = function(){\n return _easeQuarticActionOut;\n};\n\n/**\n * !#en\n * Creates the action easing object.
\n * Reference easeInOutQuart:
\n * http://www.zhihu.com/question/21981571/answer/19925418\n * !#zh\n * 创建 easeQuarticActionInOut 缓动对象。
\n * EaseQuarticInOut 是按四次函数缓动进入并退出的动作。
\n * 参考 easeInOutQuart:http://www.zhihu.com/question/21981571/answer/19925418\n * @method easeQuarticActionInOut\n * @returns {Object}\n */\nvar _easeQuarticActionInOut = {\n easing: function(time){\n time = time*2;\n if (time < 1)\n return 0.5 * time * time * time * time;\n time -= 2;\n return -0.5 * (time * time * time * time - 2);\n },\n reverse: function(){\n return _easeQuarticActionInOut;\n }\n};\ncc.easeQuarticActionInOut = function(){\n return _easeQuarticActionInOut;\n};\n\n/**\n * !#en\n * Creates the action easing object.
\n * Reference easeInQuint:
\n * http://www.zhihu.com/question/21981571/answer/19925418\n * !#zh\n * 创建 easeQuinticActionIn 缓动对象。
\n * EaseQuinticIn 是按五次函数缓动进的动作。
\n * 参考 easeInQuint:http://www.zhihu.com/question/21981571/answer/19925418\n * @method easeQuinticActionIn\n * @returns {Object}\n * @example\n * //example\n * action.easing(cc.easeQuinticActionIn());\n */\nvar _easeQuinticActionIn = {\n easing: function(time){\n return time * time * time * time * time;\n },\n reverse: function(){\n return _easeQuinticActionIn;\n }\n};\ncc.easeQuinticActionIn = function(){\n return _easeQuinticActionIn;\n};\n\n/**\n * !#en\n * Creates the action easing object.
\n * Reference easeOutQuint:
\n * http://www.zhihu.com/question/21981571/answer/19925418\n * !#zh\n * 创建 easeQuinticActionOut 缓动对象。
\n * EaseQuinticOut 是按五次函数缓动退出的动作\n * 参考 easeOutQuint:http://www.zhihu.com/question/21981571/answer/19925418\n * @method easeQuinticActionOut\n * @returns {Object}\n * @example\n * //example\n * action.easing(cc.easeQuadraticActionOut());\n */\nvar _easeQuinticActionOut = {\n easing: function(time){\n time -=1;\n return (time * time * time * time * time + 1);\n },\n reverse: function(){\n return _easeQuinticActionOut;\n }\n};\ncc.easeQuinticActionOut = function(){\n return _easeQuinticActionOut;\n};\n\n/**\n * !#en\n * Creates the action easing object.
\n * Reference easeInOutQuint:
\n * http://www.zhihu.com/question/21981571/answer/19925418\n * !#zh\n * 创建 easeQuinticActionInOut 缓动对象。
\n * EaseQuinticInOut是按五次函数缓动进入并退出的动作。
\n * 参考 easeInOutQuint:http://www.zhihu.com/question/21981571/answer/19925418\n * @method easeQuinticActionInOut\n * @returns {Object}\n * @example\n * //example\n * action.easing(cc.easeQuinticActionInOut());\n */\nvar _easeQuinticActionInOut = {\n easing: function(time){\n time = time*2;\n if (time < 1)\n return 0.5 * time * time * time * time * time;\n time -= 2;\n return 0.5 * (time * time * time * time * time + 2);\n },\n reverse: function(){\n return _easeQuinticActionInOut;\n }\n};\ncc.easeQuinticActionInOut = function(){\n return _easeQuinticActionInOut;\n};\n\n/**\n * !#en\n * Creates the action easing object.
\n * Reference easeInCirc:
\n * http://www.zhihu.com/question/21981571/answer/19925418\n * !#zh\n * 创建 easeCircleActionIn 缓动对象。
\n * EaseCircleIn是按圆形曲线缓动进入的动作。
\n * 参考 easeInCirc:http://www.zhihu.com/question/21981571/answer/19925418\n * @method easeCircleActionIn\n * @returns {Object}\n * @example\n * //example\n * action.easing(cc.easeCircleActionIn());\n */\nvar _easeCircleActionIn = {\n easing: function(time){\n return -1 * (Math.sqrt(1 - time * time) - 1);\n },\n reverse: function(){\n return _easeCircleActionIn;\n }\n};\ncc.easeCircleActionIn = function(){\n return _easeCircleActionIn;\n};\n\n/**\n * !#en\n * Creates the action easing object.
\n * Reference easeOutCirc:
\n * http://www.zhihu.com/question/21981571/answer/19925418\n * !#zh\n * 创建 easeCircleActionOut 缓动对象。
\n * EaseCircleOut是按圆形曲线缓动退出的动作。
\n * 参考 easeOutCirc:http://www.zhihu.com/question/21981571/answer/19925418\n * @method easeCircleActionOut\n * @returns {Object}\n * @example\n * //example\n * actioneasing(cc.easeCircleActionOut());\n */\nvar _easeCircleActionOut = {\n easing: function(time){\n time = time - 1;\n return Math.sqrt(1 - time * time);\n },\n reverse: function(){\n return _easeCircleActionOut;\n }\n};\ncc.easeCircleActionOut = function(){\n return _easeCircleActionOut;\n};\n\n/**\n * !#en\n * Creates the action easing object.
\n * Reference easeInOutCirc:
\n * http://www.zhihu.com/question/21981571/answer/19925418\n * !#zh\n * 创建 easeCircleActionInOut 缓动对象。
\n * EaseCircleInOut 是按圆形曲线缓动进入并退出的动作。
\n * 参考 easeInOutCirc:http://www.zhihu.com/question/21981571/answer/19925418\n * @method easeCircleActionInOut\n * @returns {Object}\n * @example\n * //example\n * action.easing(cc.easeCircleActionInOut());\n */\nvar _easeCircleActionInOut = {\n easing: function(time){\n time = time * 2;\n if (time < 1)\n return -0.5 * (Math.sqrt(1 - time * time) - 1);\n time -= 2;\n return 0.5 * (Math.sqrt(1 - time * time) + 1);\n },\n reverse: function(){\n return _easeCircleActionInOut;\n }\n};\ncc.easeCircleActionInOut = function(){\n return _easeCircleActionInOut;\n};\n\n/**\n * !#en\n * Creates the action easing object.
\n * Reference easeInCubic:
\n * http://www.zhihu.com/question/21981571/answer/19925418\n * !#zh\n * 创建 easeCubicActionIn 缓动对象。
\n * EaseCubicIn 是按三次函数缓动进入的动作。
\n * 参考 easeInCubic:http://www.zhihu.com/question/21981571/answer/19925418\n * @method easeCubicActionIn\n * @returns {Object}\n * @example\n * //example\n * action.easing(cc.easeCubicActionIn());\n */\nvar _easeCubicActionIn = {\n easing: function(time){\n return time * time * time;\n },\n reverse: function(){\n return _easeCubicActionIn;\n }\n};\ncc.easeCubicActionIn = function(){\n return _easeCubicActionIn;\n};\n\n/**\n * !#en\n * Creates the action easing object.
\n * Reference easeOutCubic:
\n * http://www.zhihu.com/question/21981571/answer/19925418\n * !#zh\n * 创建 easeCubicActionOut 缓动对象。
\n * EaseCubicOut 是按三次函数缓动退出的动作。
\n * 参考 easeOutCubic:http://www.zhihu.com/question/21981571/answer/19925418\n * @method easeCubicActionOut\n * @returns {Object}\n * @example\n * //example\n * action.easing(cc.easeCubicActionOut());\n */\nvar _easeCubicActionOut = {\n easing: function(time){\n time -= 1;\n return (time * time * time + 1);\n },\n reverse: function(){\n return _easeCubicActionOut;\n }\n};\ncc.easeCubicActionOut = function(){\n return _easeCubicActionOut;\n};\n\n/**\n * !#en\n * Creates the action easing object.
\n * Reference easeInOutCubic:
\n * http://www.zhihu.com/question/21981571/answer/19925418\n * !#zh\n * 创建 easeCubicActionInOut 缓动对象。
\n * EaseCubicInOut是按三次函数缓动进入并退出的动作。
\n * 参考 easeInOutCubic:http://www.zhihu.com/question/21981571/answer/19925418\n * @method easeCubicActionInOut\n * @returns {Object}\n */\nvar _easeCubicActionInOut = {\n easing: function(time){\n time = time*2;\n if (time < 1)\n return 0.5 * time * time * time;\n time -= 2;\n return 0.5 * (time * time * time + 2);\n },\n reverse: function(){\n return _easeCubicActionInOut;\n }\n};\ncc.easeCubicActionInOut = function(){\n return _easeCubicActionInOut;\n};\n\n","/****************************************************************************\n Copyright (c) 2008-2010 Ricardo Quesada\n Copyright (c) 2011-2012 cocos2d-x.org\n Copyright (c) 2013-2016 Chukong Technologies Inc.\n Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n/**\n * @module cc\n */\n\n/**\n * !#en Instant actions are immediate actions. They don't have a duration like the ActionInterval actions.\n * !#zh 即时动作,这种动作立即就会执行,继承自 FiniteTimeAction。\n * @class ActionInstant\n * @extends FiniteTimeAction\n */\ncc.ActionInstant = cc.Class({\n name: 'cc.ActionInstant',\n extends: cc.FiniteTimeAction,\n isDone:function () {\n return true;\n },\n\n step:function (dt) {\n this.update(1);\n },\n\n update:function (dt) {\n //nothing\n },\n\n /**\n * returns a reversed action.
\n * For example:
\n * - The action is x coordinates of 0 move to 100.
\n * - The reversed action will be x of 100 move to 0.\n * @returns {Action}\n */\n reverse:function(){\n return this.clone();\n },\n\n clone:function(){\n return new cc.ActionInstant();\n }\n});\n\n/**\n * @module cc\n */\n\n/*\n * Show the node.\n * @class Show\n * @extends ActionInstant\n */\ncc.Show = cc.Class({\n name: 'cc.Show',\n extends: cc.ActionInstant,\n\n update:function (dt) {\n var _renderComps = this.target.getComponentsInChildren(cc.RenderComponent);\n for (var i = 0; i < _renderComps.length; ++i) {\n var render = _renderComps[i];\n render.enabled = true;\n }\n },\n\n reverse:function () {\n return new cc.Hide();\n },\n\n clone:function(){\n return new cc.Show();\n }\n});\n\n/**\n * !#en Show the Node.\n * !#zh 立即显示。\n * @method show\n * @return {ActionInstant}\n * @example\n * // example\n * var showAction = cc.show();\n */\ncc.show = function () {\n return new cc.Show();\n};\n\n/*\n * Hide the node.\n * @class Hide\n * @extends ActionInstant\n */\ncc.Hide = cc.Class({\n name: 'cc.Hide',\n extends: cc.ActionInstant,\n\n update:function (dt) {\n var _renderComps = this.target.getComponentsInChildren(cc.RenderComponent);\n for (var i = 0; i < _renderComps.length; ++i) {\n var render = _renderComps[i];\n render.enabled = false;\n }\n },\n\n reverse:function () {\n return new cc.Show();\n },\n\n clone:function(){\n return new cc.Hide();\n }\n});\n\n/**\n * !#en Hide the node.\n * !#zh 立即隐藏。\n * @method hide\n * @return {ActionInstant}\n * @example\n * // example\n * var hideAction = cc.hide();\n */\ncc.hide = function () {\n return new cc.Hide();\n};\n\n/*\n * Toggles the visibility of a node.\n * @class ToggleVisibility\n * @extends ActionInstant\n */\ncc.ToggleVisibility = cc.Class({\n name: 'cc.ToggleVisibility',\n extends: cc.ActionInstant,\n\n update:function (dt) {\n var _renderComps = this.target.getComponentsInChildren(cc.RenderComponent);\n for (var i = 0; i < _renderComps.length; ++i) {\n var render = _renderComps[i];\n render.enabled = !render.enabled;\n }\n },\n\n reverse:function () {\n return new cc.ToggleVisibility();\n },\n\n clone:function(){\n return new cc.ToggleVisibility();\n }\n});\n\n/**\n * !#en Toggles the visibility of a node.\n * !#zh 显隐状态切换。\n * @method toggleVisibility\n * @return {ActionInstant}\n * @example\n * // example\n * var toggleVisibilityAction = cc.toggleVisibility();\n */\ncc.toggleVisibility = function () {\n return new cc.ToggleVisibility();\n};\n\n/*\n * Delete self in the next frame.\n * @class RemoveSelf\n * @extends ActionInstant\n * @param {Boolean} [isNeedCleanUp=true]\n *\n * @example\n * // example\n * var removeSelfAction = new cc.RemoveSelf(false);\n */\ncc.RemoveSelf = cc.Class({\n name: 'cc.RemoveSelf',\n extends: cc.ActionInstant,\n\n ctor:function(isNeedCleanUp){\n this._isNeedCleanUp = true;\n\t isNeedCleanUp !== undefined && this.init(isNeedCleanUp);\n },\n\n update:function(dt){\n this.target.removeFromParent(this._isNeedCleanUp);\n },\n\n init:function(isNeedCleanUp){\n this._isNeedCleanUp = isNeedCleanUp;\n return true;\n },\n\n reverse:function(){\n return new cc.RemoveSelf(this._isNeedCleanUp);\n },\n\n clone:function(){\n return new cc.RemoveSelf(this._isNeedCleanUp);\n }\n});\n\n/**\n * !#en Create a RemoveSelf object with a flag indicate whether the target should be cleaned up while removing.\n * !#zh 从父节点移除自身。\n * @method removeSelf\n * @param {Boolean} [isNeedCleanUp = true]\n * @return {ActionInstant}\n *\n * @example\n * // example\n * var removeSelfAction = cc.removeSelf();\n */\ncc.removeSelf = function(isNeedCleanUp){\n return new cc.RemoveSelf(isNeedCleanUp);\n};\n\n/*\n * Create an action to destroy self.\n * @class DestroySelf\n * @extends ActionInstant\n *\n * @example\n * var destroySelfAction = new cc.DestroySelf();\n */\ncc.DestroySelf = cc.Class({\n name: 'cc.DestroySelf',\n extends: cc.ActionInstant,\n\n update () {\n this.target.destroy();\n },\n\n reverse () {\n return new cc.DestroySelf();\n },\n\n clone () {\n return new cc.DestroySelf();\n }\n});\n\n/**\n * !#en Destroy self\n * !#zh 创建一个销毁自身的动作。\n * @method destroySelf\n * @return {ActionInstant}\n *\n * @example\n * var destroySelfAction = cc.destroySelf();\n */\ncc.destroySelf = function () {\n return new cc.DestroySelf();\n};\n\n/*\n * Flips the sprite horizontally.\n * @class FlipX\n * @extends ActionInstant\n * @param {Boolean} flip Indicate whether the target should be flipped or not\n *\n * @example\n * var flipXAction = new cc.FlipX(true);\n */\ncc.FlipX = cc.Class({\n name: 'cc.FlipX',\n extends: cc.ActionInstant,\n\n ctor:function(flip){\n this._flippedX = false;\n\t\tflip !== undefined && this.initWithFlipX(flip);\n },\n\n /*\n * initializes the action with a set flipX.\n * @param {Boolean} flip\n * @return {Boolean}\n */\n initWithFlipX:function (flip) {\n this._flippedX = flip;\n return true;\n },\n\n update:function (dt) {\n this.target.scaleX = Math.abs(this.target.scaleX) * (this._flippedX ? -1 : 1);\n },\n\n reverse:function () {\n return new cc.FlipX(!this._flippedX);\n },\n\n clone:function(){\n var action = new cc.FlipX();\n action.initWithFlipX(this._flippedX);\n return action;\n }\n});\n\n/**\n * !#en Create a FlipX action to flip or unflip the target.\n * !#zh X轴翻转。\n * @method flipX\n * @param {Boolean} flip Indicate whether the target should be flipped or not\n * @return {ActionInstant}\n * @example\n * var flipXAction = cc.flipX(true);\n */\ncc.flipX = function (flip) {\n return new cc.FlipX(flip);\n};\n\n/*\n * Flips the sprite vertically\n * @class FlipY\n * @extends ActionInstant\n * @param {Boolean} flip\n * @example\n * var flipYAction = new cc.FlipY(true);\n */\ncc.FlipY = cc.Class({\n name: 'cc.FlipY',\n extends: cc.ActionInstant,\n\n ctor: function(flip){\n this._flippedY = false;\n\t\tflip !== undefined && this.initWithFlipY(flip);\n },\n\n /*\n * initializes the action with a set flipY.\n * @param {Boolean} flip\n * @return {Boolean}\n */\n initWithFlipY:function (flip) {\n this._flippedY = flip;\n return true;\n },\n\n update:function (dt) {\n this.target.scaleY = Math.abs(this.target.scaleY) * (this._flippedY ? -1 : 1);\n },\n\n reverse:function () {\n return new cc.FlipY(!this._flippedY);\n },\n\n clone:function(){\n var action = new cc.FlipY();\n action.initWithFlipY(this._flippedY);\n return action;\n }\n});\n\n/**\n * !#en Create a FlipY action to flip or unflip the target.\n * !#zh Y轴翻转。\n * @method flipY\n * @param {Boolean} flip\n * @return {ActionInstant}\n * @example\n * var flipYAction = cc.flipY(true);\n */\ncc.flipY = function (flip) {\n return new cc.FlipY(flip);\n};\n\n/*\n * Places the node in a certain position\n * @class Place\n * @extends ActionInstant\n * @param {Vec2|Number} pos\n * @param {Number} [y]\n * @example\n * var placeAction = new cc.Place(cc.v2(200, 200));\n * var placeAction = new cc.Place(200, 200);\n */\ncc.Place = cc.Class({\n name: 'cc.Place',\n extends: cc.ActionInstant,\n\n ctor:function(pos, y){\n this._x = 0;\n\t this._y = 0;\n\n\t\tif (pos !== undefined) {\n\t\t\tif (pos.x !== undefined) {\n\t\t\t\ty = pos.y;\n\t\t\t\tpos = pos.x;\n\t\t\t}\n\t\t\tthis.initWithPosition(pos, y);\n\t\t}\n },\n\n /*\n * Initializes a Place action with a position\n * @param {number} x\n * @param {number} y\n * @return {Boolean}\n */\n initWithPosition: function (x, y) {\n this._x = x;\n this._y = y;\n return true;\n },\n\n update:function (dt) {\n this.target.setPosition(this._x, this._y);\n },\n\n clone:function(){\n var action = new cc.Place();\n action.initWithPosition(this._x, this._y);\n return action;\n }\n});\n\n/**\n * !#en Creates a Place action with a position.\n * !#zh 放置在目标位置。\n * @method place\n * @param {Vec2|Number} pos\n * @param {Number} [y]\n * @return {ActionInstant}\n * @example\n * // example\n * var placeAction = cc.place(cc.v2(200, 200));\n * var placeAction = cc.place(200, 200);\n */\ncc.place = function (pos, y) {\n return new cc.Place(pos, y);\n};\n\n\n/*\n * Calls a 'callback'.\n * @class CallFunc\n * @extends ActionInstant\n * @param {function} selector\n * @param {object} [selectorTarget=null]\n * @param {*} [data=null] data for function, it accepts all data types.\n * @example\n * // example\n * // CallFunc without data\n * var finish = new cc.CallFunc(this.removeSprite, this);\n *\n * // CallFunc with data\n * var finish = new cc.CallFunc(this.removeFromParentAndCleanup, this, true);\n */\ncc.CallFunc = cc.Class({\n name: 'cc.CallFunc',\n extends: cc.ActionInstant,\n\n /*\n * Constructor function, override it to extend the construction behavior, remember to call \"this._super()\" in the extended \"ctor\" function.
\n\t * Creates a CallFunc action with the callback.\n\t * @param {function} selector\n\t * @param {object} [selectorTarget=null]\n\t * @param {*} [data=null] data for function, it accepts all data types.\n\t */\n ctor:function(selector, selectorTarget, data){\n this._selectorTarget = null;\n this._function = null;\n this._data = null;\n this.initWithFunction(selector, selectorTarget, data);\n },\n\n /*\n * Initializes the action with a function or function and its target\n * @param {function} selector\n * @param {object|Null} selectorTarget\n * @param {*|Null} [data] data for function, it accepts all data types.\n * @return {Boolean}\n */\n initWithFunction:function (selector, selectorTarget, data) {\n if (selector) {\n this._function = selector;\n }\n if (selectorTarget) {\n this._selectorTarget = selectorTarget;\n }\n if (data !== undefined) {\n this._data = data;\n }\n return true;\n },\n\n /*\n * execute the function.\n */\n execute:function () {\n if (this._function) {\n this._function.call(this._selectorTarget, this.target, this._data);\n }\n },\n\n update:function (dt) {\n this.execute();\n },\n\n /*\n * Get selectorTarget.\n * @return {object}\n */\n getTargetCallback:function () {\n return this._selectorTarget;\n },\n\n /*\n * Set selectorTarget.\n * @param {object} sel\n */\n setTargetCallback:function (sel) {\n if (sel !== this._selectorTarget) {\n if (this._selectorTarget)\n this._selectorTarget = null;\n this._selectorTarget = sel;\n }\n },\n\n clone:function(){\n var action = new cc.CallFunc();\n action.initWithFunction(this._function, this._selectorTarget, this._data);\n return action;\n }\n});\n\n/**\n * !#en Creates the action with the callback.\n * !#zh 执行回调函数。\n * @method callFunc\n * @param {function} selector\n * @param {object} [selectorTarget=null]\n * @param {*} [data=null] - data for function, it accepts all data types.\n * @return {ActionInstant}\n * @example\n * // example\n * // CallFunc without data\n * var finish = cc.callFunc(this.removeSprite, this);\n *\n * // CallFunc with data\n * var finish = cc.callFunc(this.removeFromParentAndCleanup, this._grossini, true);\n */\ncc.callFunc = function (selector, selectorTarget, data) {\n return new cc.CallFunc(selector, selectorTarget, data);\n};\n","/****************************************************************************\n Copyright (c) 2008-2010 Ricardo Quesada\n Copyright (c) 2011-2012 cocos2d-x.org\n Copyright (c) 2013-2016 Chukong Technologies Inc.\n Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n\n/**\n * @module cc\n */\n\n/**\n * !#en\n *
\n * It has an start time, and a finish time. The finish time is the parameter
\n * duration plus the start time.
\n * - They can run normally (default)
\n * - They can run reversed with the reverse method
\n * - They can run with the time altered with the Accelerate, AccelDeccel and Speed actions.
\n * then running it again in Reverse mode.
\n * Useful to simulate 'slow motion' or 'fast forward' effect.\n * !#zh\n * 改变一个动作的速度,使它的执行使用更长的时间(speed > 1)
\n * 或更少(speed < 1)可以有效得模拟“慢动作”或“快进”的效果。\n * @param {Number} speed\n * @returns {Action}\n */\n speed: function(speed){\n if(speed <= 0){\n cc.logID(1013);\n return this;\n }\n\n this._speedMethod = true;//Compatible with repeat class, Discard after can be deleted\n this._speed *= speed;\n return this;\n },\n\n /**\n * Get this action speed.\n * @return {Number}\n */\n getSpeed: function(){\n return this._speed;\n },\n\n /**\n * Set this action speed.\n * @param {Number} speed\n * @returns {ActionInterval}\n */\n setSpeed: function(speed){\n this._speed = speed;\n return this;\n },\n\n /**\n * !#en\n * Repeats an action a number of times.\n * To repeat an action forever use the CCRepeatForever action.\n * !#zh 重复动作可以按一定次数重复一个动作,使用 RepeatForever 动作来永远重复一个动作。\n * @method repeat\n * @param {Number} times\n * @returns {ActionInterval}\n */\n repeat: function(times){\n times = Math.round(times);\n if(isNaN(times) || times < 1){\n cc.logID(1014);\n return this;\n }\n this._repeatMethod = true;//Compatible with repeat class, Discard after can be deleted\n this._timesForRepeat *= times;\n return this;\n },\n\n /**\n * !#en\n * Repeats an action for ever.
\n * To repeat the an action for a limited number of times use the Repeat action.
\n * !#zh 永远地重复一个动作,有限次数内重复一个动作请使用 Repeat 动作。\n * @method repeatForever\n * @returns {ActionInterval}\n */\n repeatForever: function(){\n this._repeatMethod = true;//Compatible with repeat class, Discard after can be deleted\n this._timesForRepeat = this.MAX_VALUE;\n this._repeatForever = true;\n return this;\n }\n});\n\ncc.actionInterval = function (d) {\n return new cc.ActionInterval(d);\n};\n\n/**\n * @module cc\n */\n\n/*\n * Runs actions sequentially, one after another.\n * @class Sequence\n * @extends ActionInterval\n * @param {Array|FiniteTimeAction} tempArray\n * @example\n * // create sequence with actions\n * var seq = new cc.Sequence(act1, act2);\n *\n * // create sequence with array\n * var seq = new cc.Sequence(actArray);\n */\ncc.Sequence = cc.Class({\n name: 'cc.Sequence',\n extends: cc.ActionInterval,\n\n ctor:function (tempArray) {\n this._actions = [];\n this._split = null;\n this._last = 0;\n this._reversed = false;\n\n var paramArray = (tempArray instanceof Array) ? tempArray : arguments;\n if (paramArray.length === 1) {\n cc.errorID(1019);\n return;\n }\n var last = paramArray.length - 1;\n if ((last >= 0) && (paramArray[last] == null))\n cc.logID(1015);\n\n if (last >= 0) {\n var prev = paramArray[0], action1;\n for (var i = 1; i < last; i++) {\n if (paramArray[i]) {\n action1 = prev;\n prev = cc.Sequence._actionOneTwo(action1, paramArray[i]);\n }\n }\n this.initWithTwoActions(prev, paramArray[last]);\n }\n },\n\n /*\n * Initializes the action
\n * @param {FiniteTimeAction} actionOne\n * @param {FiniteTimeAction} actionTwo\n * @return {Boolean}\n */\n initWithTwoActions:function (actionOne, actionTwo) {\n if (!actionOne || !actionTwo) {\n cc.errorID(1025);\n return false;\n }\n\n var durationOne = actionOne._duration, durationTwo = actionTwo._duration;\n durationOne *= actionOne._repeatMethod ? actionOne._timesForRepeat : 1;\n durationTwo *= actionTwo._repeatMethod ? actionTwo._timesForRepeat : 1;\n var d = durationOne + durationTwo;\n this.initWithDuration(d);\n\n this._actions[0] = actionOne;\n this._actions[1] = actionTwo;\n return true;\n },\n\n clone:function () {\n var action = new cc.Sequence();\n this._cloneDecoration(action);\n action.initWithTwoActions(this._actions[0].clone(), this._actions[1].clone());\n return action;\n },\n\n startWithTarget:function (target) {\n cc.ActionInterval.prototype.startWithTarget.call(this, target);\n this._split = this._actions[0]._duration / this._duration;\n this._split *= this._actions[0]._repeatMethod ? this._actions[0]._timesForRepeat : 1;\n this._last = -1;\n },\n\n stop:function () {\n // Issue #1305\n if (this._last !== -1)\n this._actions[this._last].stop();\n cc.Action.prototype.stop.call(this);\n },\n\n update:function (dt) {\n var new_t, found = 0;\n var locSplit = this._split, locActions = this._actions, locLast = this._last, actionFound;\n\n dt = this._computeEaseTime(dt);\n if (dt < locSplit) {\n // action[0]\n new_t = (locSplit !== 0) ? dt / locSplit : 1;\n\n if (found === 0 && locLast === 1 && this._reversed) {\n // Reverse mode ?\n // XXX: Bug. this case doesn't contemplate when _last==-1, found=0 and in \"reverse mode\"\n // since it will require a hack to know if an action is on reverse mode or not.\n // \"step\" should be overriden, and the \"reverseMode\" value propagated to inner Sequences.\n locActions[1].update(0);\n locActions[1].stop();\n }\n } else {\n // action[1]\n found = 1;\n new_t = (locSplit === 1) ? 1 : (dt - locSplit) / (1 - locSplit);\n\n if (locLast === -1) {\n // action[0] was skipped, execute it.\n locActions[0].startWithTarget(this.target);\n locActions[0].update(1);\n locActions[0].stop();\n }\n if (locLast === 0) {\n // switching to action 1. stop action 0.\n locActions[0].update(1);\n locActions[0].stop();\n }\n }\n\n actionFound = locActions[found];\n // Last action found and it is done.\n if (locLast === found && actionFound.isDone())\n return;\n\n // Last action not found\n if (locLast !== found)\n actionFound.startWithTarget(this.target);\n\n new_t = new_t * actionFound._timesForRepeat;\n actionFound.update(new_t > 1 ? new_t % 1 : new_t);\n this._last = found;\n },\n\n reverse:function () {\n var action = cc.Sequence._actionOneTwo(this._actions[1].reverse(), this._actions[0].reverse());\n this._cloneDecoration(action);\n this._reverseEaseList(action);\n action._reversed = true;\n return action;\n }\n});\n\n/**\n * !#en\n * Helper constructor to create an array of sequenceable actions\n * The created action will run actions sequentially, one after another.\n * !#zh 顺序执行动作,创建的动作将按顺序依次运行。\n * @method sequence\n * @param {FiniteTimeAction|FiniteTimeAction[]} actionOrActionArray\n * @param {FiniteTimeAction} ...tempArray\n * @return {ActionInterval}\n * @example\n * // example\n * // create sequence with actions\n * var seq = cc.sequence(act1, act2);\n *\n * // create sequence with array\n * var seq = cc.sequence(actArray);\n */\n// todo: It should be use new\ncc.sequence = function (/*Multiple Arguments*/tempArray) {\n var paramArray = (tempArray instanceof Array) ? tempArray : arguments;\n if (paramArray.length === 1) {\n cc.errorID(1019);\n return null;\n }\n var last = paramArray.length - 1;\n if ((last >= 0) && (paramArray[last] == null))\n cc.logID(1015);\n\n var result = null;\n if (last >= 0) {\n result = paramArray[0];\n for (var i = 1; i <= last; i++) {\n if (paramArray[i]) {\n result = cc.Sequence._actionOneTwo(result, paramArray[i]);\n }\n }\n }\n\n return result;\n};\n\ncc.Sequence._actionOneTwo = function (actionOne, actionTwo) {\n var sequence = new cc.Sequence();\n sequence.initWithTwoActions(actionOne, actionTwo);\n return sequence;\n};\n\n/*\n * Repeats an action a number of times.\n * To repeat an action forever use the CCRepeatForever action.\n * @class Repeat\n * @extends ActionInterval\n * @param {FiniteTimeAction} action\n * @param {Number} times\n * @example\n * var rep = new cc.Repeat(cc.sequence(jump2, jump1), 5);\n */\ncc.Repeat = cc.Class({\n name: 'cc.Repeat',\n extends: cc.ActionInterval,\n\n ctor: function (action, times) {\n this._times = 0;\n this._total = 0;\n this._nextDt = 0;\n this._actionInstant = false;\n this._innerAction = null;\n\t\ttimes !== undefined && this.initWithAction(action, times);\n },\n\n /*\n * @param {FiniteTimeAction} action\n * @param {Number} times\n * @return {Boolean}\n */\n initWithAction:function (action, times) {\n var duration = action._duration * times;\n\n if (this.initWithDuration(duration)) {\n this._times = times;\n this._innerAction = action;\n if (action instanceof cc.ActionInstant){\n this._actionInstant = true;\n this._times -= 1;\n }\n this._total = 0;\n return true;\n }\n return false;\n },\n\n clone:function () {\n var action = new cc.Repeat();\n this._cloneDecoration(action);\n action.initWithAction(this._innerAction.clone(), this._times);\n return action;\n },\n\n startWithTarget:function (target) {\n this._total = 0;\n this._nextDt = this._innerAction._duration / this._duration;\n cc.ActionInterval.prototype.startWithTarget.call(this, target);\n this._innerAction.startWithTarget(target);\n },\n\n stop:function () {\n this._innerAction.stop();\n cc.Action.prototype.stop.call(this);\n },\n\n update:function (dt) {\n dt = this._computeEaseTime(dt);\n var locInnerAction = this._innerAction;\n var locDuration = this._duration;\n var locTimes = this._times;\n var locNextDt = this._nextDt;\n\n if (dt >= locNextDt) {\n while (dt > locNextDt && this._total < locTimes) {\n locInnerAction.update(1);\n this._total++;\n locInnerAction.stop();\n locInnerAction.startWithTarget(this.target);\n locNextDt += locInnerAction._duration / locDuration;\n this._nextDt = locNextDt > 1 ? 1 : locNextDt;\n }\n\n // fix for issue #1288, incorrect end value of repeat\n if (dt >= 1.0 && this._total < locTimes) {\n // fix for cocos-creator/fireball/issues/4310\n locInnerAction.update(1);\n this._total++;\n }\n\n // don't set a instant action back or update it, it has no use because it has no duration\n if (!this._actionInstant) {\n if (this._total === locTimes) {\n locInnerAction.stop();\n } else {\n // issue #390 prevent jerk, use right update\n locInnerAction.update(dt - (locNextDt - locInnerAction._duration / locDuration));\n }\n }\n } else {\n locInnerAction.update((dt * locTimes) % 1.0);\n }\n },\n\n isDone:function () {\n return this._total === this._times;\n },\n\n reverse:function () {\n var action = new cc.Repeat(this._innerAction.reverse(), this._times);\n this._cloneDecoration(action);\n this._reverseEaseList(action);\n return action;\n },\n\n /*\n * Set inner Action.\n * @param {FiniteTimeAction} action\n */\n setInnerAction:function (action) {\n if (this._innerAction !== action) {\n this._innerAction = action;\n }\n },\n\n /*\n * Get inner Action.\n * @return {FiniteTimeAction}\n */\n getInnerAction:function () {\n return this._innerAction;\n }\n});\n\n/**\n * !#en Creates a Repeat action. Times is an unsigned integer between 1 and pow(2,30)\n * !#zh 重复动作,可以按一定次数重复一个动,如果想永远重复一个动作请使用 repeatForever 动作来完成。\n * @method repeat\n * @param {FiniteTimeAction} action\n * @param {Number} times\n * @return {ActionInterval}\n * @example\n * // example\n * var rep = cc.repeat(cc.sequence(jump2, jump1), 5);\n */\ncc.repeat = function (action, times) {\n return new cc.Repeat(action, times);\n};\n\n\ncc.repeatForever = function (action) {\n return new cc.RepeatForever(action);\n}\n\n\n/*\n * Repeats an action for ever.
\n * To repeat the an action for a limited number of times use the Repeat action.
\n * @warning This action can't be Sequenceable because it is not an IntervalAction\n * @class RepeatForever\n * @extends ActionInterval\n * @param {FiniteTimeAction} action\n * @example\n * var rep = new cc.RepeatForever(cc.sequence(jump2, jump1), 5);\n */\ncc.RepeatForever = cc.Class({\n name: 'cc.RepeatForever',\n extends: cc.ActionInterval,\n\n ctor:function (action) {\n this._innerAction = null;\n\t\taction && this.initWithAction(action);\n },\n\n /*\n * @param {ActionInterval} action\n * @return {Boolean}\n */\n initWithAction:function (action) {\n if (!action) {\n cc.errorID(1026);\n return false;\n }\n\n this._innerAction = action;\n return true;\n },\n\n clone:function () {\n var action = new cc.RepeatForever();\n this._cloneDecoration(action);\n action.initWithAction(this._innerAction.clone());\n return action;\n },\n\n startWithTarget:function (target) {\n cc.ActionInterval.prototype.startWithTarget.call(this, target);\n this._innerAction.startWithTarget(target);\n },\n\n step:function (dt) {\n var locInnerAction = this._innerAction;\n locInnerAction.step(dt);\n if (locInnerAction.isDone()) {\n //var diff = locInnerAction.getElapsed() - locInnerAction._duration;\n locInnerAction.startWithTarget(this.target);\n // to prevent jerk. issue #390 ,1247\n //this._innerAction.step(0);\n //this._innerAction.step(diff);\n locInnerAction.step(locInnerAction.getElapsed() - locInnerAction._duration);\n }\n },\n\n isDone:function () {\n return false;\n },\n\n reverse:function () {\n var action = new cc.RepeatForever(this._innerAction.reverse());\n this._cloneDecoration(action);\n this._reverseEaseList(action);\n return action;\n },\n\n /*\n * Set inner action.\n * @param {ActionInterval} action\n */\n setInnerAction:function (action) {\n if (this._innerAction !== action) {\n this._innerAction = action;\n }\n },\n\n /*\n * Get inner action.\n * @return {ActionInterval}\n */\n getInnerAction:function () {\n return this._innerAction;\n }\n});\n\n/**\n * !#en Create a acton which repeat forever, as it runs forever, it can't be added into cc.sequence and cc.spawn.\n * !#zh 永远地重复一个动作,有限次数内重复一个动作请使用 repeat 动作,由于这个动作不会停止,所以不能被添加到 cc.sequence 或 cc.spawn 中。\n * @method repeatForever\n * @param {FiniteTimeAction} action\n * @return {ActionInterval}\n * @example\n * // example\n * var repeat = cc.repeatForever(cc.rotateBy(1.0, 360));\n */\ncc.repeatForever = function (action) {\n return new cc.RepeatForever(action);\n};\n\n\n/* \n * Spawn a new action immediately\n * @class Spawn\n * @extends ActionInterval\n */\ncc.Spawn = cc.Class({\n name: 'cc.Spawn',\n extends: cc.ActionInterval,\n\n ctor:function (tempArray) {\n this._one = null;\n this._two = null;\n\n\t\tvar paramArray = (tempArray instanceof Array) ? tempArray : arguments;\n if (paramArray.length === 1) {\n cc.errorID(1020);\n return;\n }\n\t\tvar last = paramArray.length - 1;\n\t\tif ((last >= 0) && (paramArray[last] == null))\n\t\t\tcc.logID(1015);\n\n if (last >= 0) {\n var prev = paramArray[0], action1;\n for (var i = 1; i < last; i++) {\n if (paramArray[i]) {\n action1 = prev;\n prev = cc.Spawn._actionOneTwo(action1, paramArray[i]);\n }\n }\n this.initWithTwoActions(prev, paramArray[last]);\n }\n },\n\n /* initializes the Spawn action with the 2 actions to spawn\n * @param {FiniteTimeAction} action1\n * @param {FiniteTimeAction} action2\n * @return {Boolean}\n */\n initWithTwoActions:function (action1, action2) {\n if (!action1 || !action2) {\n cc.errorID(1027);\n return false;\n }\n\n var ret = false;\n\n var d1 = action1._duration;\n var d2 = action2._duration;\n\n if (this.initWithDuration(Math.max(d1, d2))) {\n this._one = action1;\n this._two = action2;\n\n if (d1 > d2) {\n this._two = cc.Sequence._actionOneTwo(action2, cc.delayTime(d1 - d2));\n } else if (d1 < d2) {\n this._one = cc.Sequence._actionOneTwo(action1, cc.delayTime(d2 - d1));\n }\n\n ret = true;\n }\n return ret;\n },\n\n clone:function () {\n var action = new cc.Spawn();\n this._cloneDecoration(action);\n action.initWithTwoActions(this._one.clone(), this._two.clone());\n return action;\n },\n\n startWithTarget:function (target) {\n cc.ActionInterval.prototype.startWithTarget.call(this, target);\n this._one.startWithTarget(target);\n this._two.startWithTarget(target);\n },\n\n stop:function () {\n this._one.stop();\n this._two.stop();\n cc.Action.prototype.stop.call(this);\n },\n\n update:function (dt) {\n dt = this._computeEaseTime(dt);\n if (this._one)\n this._one.update(dt);\n if (this._two)\n this._two.update(dt);\n },\n\n reverse:function () {\n var action = cc.Spawn._actionOneTwo(this._one.reverse(), this._two.reverse());\n this._cloneDecoration(action);\n this._reverseEaseList(action);\n return action;\n }\n});\n\n/**\n * !#en Create a spawn action which runs several actions in parallel.\n * !#zh 同步执行动作,同步执行一组动作。\n * @method spawn\n * @param {FiniteTimeAction|FiniteTimeAction[]} actionOrActionArray\n * @param {FiniteTimeAction} ...tempArray\n * @return {FiniteTimeAction}\n * @example\n * // example\n * var action = cc.spawn(cc.jumpBy(2, cc.v2(300, 0), 50, 4), cc.rotateBy(2, 720));\n * todo: It should be the direct use new\n */\ncc.spawn = function (/*Multiple Arguments*/tempArray) {\n var paramArray = (tempArray instanceof Array) ? tempArray : arguments;\n if (paramArray.length === 1) {\n cc.errorID(1020);\n return null;\n }\n if ((paramArray.length > 0) && (paramArray[paramArray.length - 1] == null))\n cc.logID(1015);\n\n var prev = paramArray[0];\n for (var i = 1; i < paramArray.length; i++) {\n if (paramArray[i] != null)\n prev = cc.Spawn._actionOneTwo(prev, paramArray[i]);\n }\n return prev;\n};\n\ncc.Spawn._actionOneTwo = function (action1, action2) {\n var pSpawn = new cc.Spawn();\n pSpawn.initWithTwoActions(action1, action2);\n return pSpawn;\n};\n\n\n/*\n * Rotates a Node object to a certain angle by modifying its angle property.
\n * The direction will be decided by the shortest angle.\n * @class RotateTo\n * @extends ActionInterval\n * @param {Number} duration duration in seconds\n * @param {Number} dstAngle dstAngle in degrees.\n * @example\n * var rotateTo = new cc.RotateTo(2, 61.0);\n */\ncc.RotateTo = cc.Class({\n name: 'cc.RotateTo',\n extends: cc.ActionInterval,\n\n statics: {\n _reverse: false,\n },\n\n ctor:function (duration, dstAngle) {\n this._startAngle = 0;\n this._dstAngle = 0;\n this._angle = 0;\n dstAngle !== undefined && this.initWithDuration(duration, dstAngle);\n },\n\n /*\n * Initializes the action.\n * @param {Number} duration\n * @param {Number} dstAngle\n * @return {Boolean}\n */\n initWithDuration:function (duration, dstAngle) {\n if (cc.ActionInterval.prototype.initWithDuration.call(this, duration)) {\n this._dstAngle = dstAngle;\n return true;\n }\n return false;\n },\n\n clone:function () {\n var action = new cc.RotateTo();\n this._cloneDecoration(action);\n action.initWithDuration(this._duration, this._dstAngle);\n return action;\n },\n\n startWithTarget:function (target) {\n cc.ActionInterval.prototype.startWithTarget.call(this, target);\n\n let startAngle = target.angle % 360;\n\n let angle = cc.RotateTo._reverse ? (this._dstAngle - startAngle) : (this._dstAngle + startAngle);\n if (angle > 180) angle -= 360;\n if (angle < -180) angle += 360;\n\n this._startAngle = startAngle;\n this._angle = cc.RotateTo._reverse ? angle : -angle;\n },\n\n reverse:function () {\n cc.logID(1016);\n },\n\n update:function (dt) {\n dt = this._computeEaseTime(dt);\n if (this.target) {\n this.target.angle = this._startAngle + this._angle * dt;\n }\n }\n});\n\n/**\n * !#en\n * Rotates a Node object to a certain angle by modifying its angle property.
\n * The direction will be decided by the shortest angle.\n * !#zh 旋转到目标角度,通过逐帧修改它的 angle 属性,旋转方向将由最短的角度决定。\n * @method rotateTo\n * @param {Number} duration duration in seconds\n * @param {Number} dstAngle dstAngle in degrees.\n * @return {ActionInterval}\n * @example\n * // example\n * var rotateTo = cc.rotateTo(2, 61.0);\n */\ncc.rotateTo = function (duration, dstAngle) {\n return new cc.RotateTo(duration, dstAngle);\n};\n\n\n/*\n * Rotates a Node object clockwise a number of degrees by modifying its angle property.\n * Relative to its properties to modify.\n * @class RotateBy\n * @extends ActionInterval\n * @param {Number} duration duration in seconds\n * @param {Number} deltaAngle deltaAngle in degrees\n * @example\n * var actionBy = new cc.RotateBy(2, 360);\n */\ncc.RotateBy = cc.Class({\n name: 'cc.RotateBy',\n extends: cc.ActionInterval,\n\n statics: {\n _reverse: false,\n },\n\n ctor: function (duration, deltaAngle) {\n deltaAngle *= cc.RotateBy._reverse ? 1 : -1;\n\n this._deltaAngle = 0;\n this._startAngle = 0;\n deltaAngle !== undefined && this.initWithDuration(duration, deltaAngle);\n },\n\n /*\n * Initializes the action.\n * @param {Number} duration duration in seconds\n * @param {Number} deltaAngle deltaAngle in degrees\n * @return {Boolean}\n */\n initWithDuration:function (duration, deltaAngle) {\n if (cc.ActionInterval.prototype.initWithDuration.call(this, duration)) {\n this._deltaAngle = deltaAngle;\n return true;\n }\n return false;\n },\n\n clone:function () {\n var action = new cc.RotateBy();\n this._cloneDecoration(action);\n action.initWithDuration(this._duration, this._deltaAngle);\n return action;\n },\n\n startWithTarget:function (target) {\n cc.ActionInterval.prototype.startWithTarget.call(this, target);\n this._startAngle = target.angle;\n },\n\n update:function (dt) {\n dt = this._computeEaseTime(dt);\n if (this.target) {\n this.target.angle = this._startAngle + this._deltaAngle * dt;\n }\n },\n\n reverse:function () {\n var action = new cc.RotateBy();\n action.initWithDuration(this._duration, -this._deltaAngle);\n this._cloneDecoration(action);\n this._reverseEaseList(action);\n return action;\n }\n});\n\n/**\n * !#en\n * Rotates a Node object clockwise a number of degrees by modifying its angle property.\n * Relative to its properties to modify.\n * !#zh 旋转指定的角度。\n * @method rotateBy\n * @param {Number} duration duration in seconds\n * @param {Number} deltaAngle deltaAngle in degrees\n * @return {ActionInterval}\n * @example\n * // example\n * var actionBy = cc.rotateBy(2, 360);\n */\ncc.rotateBy = function (duration, deltaAngle) {\n return new cc.RotateBy(duration, deltaAngle);\n};\n\n\n/*\n *
\n * x and y are relative to the position of the object.
\n * Several MoveBy actions can be concurrently called, and the resulting
\n * movement will be the sum of individual movements.\n *
\n * x and y are relative to the position of the object.
\n * Several MoveBy actions can be concurrently called, and the resulting
\n * movement will be the sum of individual movements.\n * !#zh 移动指定的距离。\n * @method moveBy\n * @param {Number} duration duration in seconds\n * @param {Vec2|Number} deltaPos\n * @param {Number} [deltaY]\n * @return {ActionInterval}\n * @example\n * // example\n * var actionTo = cc.moveBy(2, cc.v2(windowSize.width - 40, windowSize.height - 40));\n */\ncc.moveBy = function (duration, deltaPos, deltaY) {\n return new cc.MoveBy(duration, deltaPos, deltaY);\n};\n\n\n/*\n * Moves a Node object to the position x,y. x and y are absolute coordinates by modifying its position property.
\n * Several MoveTo actions can be concurrently called, and the resulting
\n * movement will be the sum of individual movements.\n * @class MoveTo\n * @extends MoveBy\n * @param {Number} duration duration in seconds\n * @param {Vec2|Number} position\n * @param {Number} [y]\n * @example\n * var actionBy = new cc.MoveTo(2, cc.v2(80, 80));\n */\ncc.MoveTo = cc.Class({\n name: 'cc.MoveTo',\n extends: cc.MoveBy,\n\n ctor:function (duration, position, y) {\n this._endPosition = cc.v2(0, 0);\n\t\tposition !== undefined && this.initWithDuration(duration, position, y);\n },\n\n /*\n * Initializes the action.\n * @param {Number} duration duration in seconds\n * @param {Vec2} position\n * @param {Number} [y]\n * @return {Boolean}\n */\n initWithDuration:function (duration, position, y) {\n if (cc.MoveBy.prototype.initWithDuration.call(this, duration, position, y)) {\n\t if(position.x !== undefined) {\n\t\t y = position.y;\n\t\t position = position.x;\n\t }\n\n this._endPosition.x = position;\n this._endPosition.y = y;\n return true;\n }\n return false;\n },\n\n clone:function () {\n var action = new cc.MoveTo();\n this._cloneDecoration(action);\n action.initWithDuration(this._duration, this._endPosition);\n return action;\n },\n\n startWithTarget:function (target) {\n cc.MoveBy.prototype.startWithTarget.call(this, target);\n this._positionDelta.x = this._endPosition.x - target.x;\n this._positionDelta.y = this._endPosition.y - target.y;\n }\n});\n\n/**\n * !#en\n * Moves a Node object to the position x,y. x and y are absolute coordinates by modifying its position property.
\n * Several MoveTo actions can be concurrently called, and the resulting
\n * movement will be the sum of individual movements.\n * !#zh 移动到目标位置。\n * @method moveTo\n * @param {Number} duration duration in seconds\n * @param {Vec2|Number} position\n * @param {Number} [y]\n * @return {ActionInterval}\n * @example\n * // example\n * var actionBy = cc.moveTo(2, cc.v2(80, 80));\n */\ncc.moveTo = function (duration, position, y) {\n return new cc.MoveTo(duration, position, y);\n};\n\n/*\n * Skews a Node object to given angles by modifying its skewX and skewY properties\n * @class SkewTo\n * @extends ActionInterval\n * @param {Number} t time in seconds\n * @param {Number} sx\n * @param {Number} sy\n * @example\n * var actionTo = new cc.SkewTo(2, 37.2, -37.2);\n */\ncc.SkewTo = cc.Class({\n name: 'cc.SkewTo',\n extends: cc.ActionInterval,\n\n ctor: function (t, sx, sy) {\n this._skewX = 0;\n this._skewY = 0;\n this._startSkewX = 0;\n this._startSkewY = 0;\n this._endSkewX = 0;\n this._endSkewY = 0;\n this._deltaX = 0;\n this._deltaY = 0;\n sy !== undefined && cc.SkewTo.prototype.initWithDuration.call(this, t, sx, sy);\n },\n\n /*\n * Initializes the action.\n * @param {Number} t time in seconds\n * @param {Number} sx\n * @param {Number} sy\n * @return {Boolean}\n */\n initWithDuration:function (t, sx, sy) {\n var ret = false;\n if (cc.ActionInterval.prototype.initWithDuration.call(this, t)) {\n this._endSkewX = sx;\n this._endSkewY = sy;\n ret = true;\n }\n return ret;\n },\n\n clone:function () {\n var action = new cc.SkewTo();\n this._cloneDecoration(action);\n action.initWithDuration(this._duration, this._endSkewX, this._endSkewY);\n return action;\n },\n\n startWithTarget:function (target) {\n cc.ActionInterval.prototype.startWithTarget.call(this, target);\n\n this._startSkewX = target.skewX % 180;\n this._deltaX = this._endSkewX - this._startSkewX;\n if (this._deltaX > 180)\n this._deltaX -= 360;\n if (this._deltaX < -180)\n this._deltaX += 360;\n\n this._startSkewY = target.skewY % 360;\n this._deltaY = this._endSkewY - this._startSkewY;\n if (this._deltaY > 180)\n this._deltaY -= 360;\n if (this._deltaY < -180)\n this._deltaY += 360;\n },\n\n update:function (dt) {\n dt = this._computeEaseTime(dt);\n this.target.skewX = this._startSkewX + this._deltaX * dt;\n this.target.skewY = this._startSkewY + this._deltaY * dt;\n }\n});\n\n/**\n * !#en\n * Create a action which skews a Node object to given angles by modifying its skewX and skewY properties.\n * Changes to the specified value.\n * !#zh 偏斜到目标角度。\n * @method skewTo\n * @param {Number} t time in seconds\n * @param {Number} sx\n * @param {Number} sy\n * @return {ActionInterval}\n * @example\n * // example\n * var actionTo = cc.skewTo(2, 37.2, -37.2);\n */\ncc.skewTo = function (t, sx, sy) {\n return new cc.SkewTo(t, sx, sy);\n};\n\n/*\n * Skews a Node object by skewX and skewY degrees.\n * Relative to its property modification.\n * @class SkewBy\n * @extends SkewTo\n * @param {Number} t time in seconds\n * @param {Number} sx skew in degrees for X axis\n * @param {Number} sy skew in degrees for Y axis\n */\ncc.SkewBy = cc.Class({\n name: 'cc.SkewBy',\n extends: cc.SkewTo,\n\n\tctor: function(t, sx, sy) {\n\t\tsy !== undefined && this.initWithDuration(t, sx, sy);\n\t},\n\n /*\n * Initializes the action.\n * @param {Number} t time in seconds\n * @param {Number} deltaSkewX skew in degrees for X axis\n * @param {Number} deltaSkewY skew in degrees for Y axis\n * @return {Boolean}\n */\n initWithDuration:function (t, deltaSkewX, deltaSkewY) {\n var ret = false;\n if (cc.SkewTo.prototype.initWithDuration.call(this, t, deltaSkewX, deltaSkewY)) {\n this._skewX = deltaSkewX;\n this._skewY = deltaSkewY;\n ret = true;\n }\n return ret;\n },\n\n clone:function () {\n var action = new cc.SkewBy();\n this._cloneDecoration(action);\n action.initWithDuration(this._duration, this._skewX, this._skewY);\n return action;\n },\n\n startWithTarget:function (target) {\n cc.SkewTo.prototype.startWithTarget.call(this, target);\n this._deltaX = this._skewX;\n this._deltaY = this._skewY;\n this._endSkewX = this._startSkewX + this._deltaX;\n this._endSkewY = this._startSkewY + this._deltaY;\n },\n\n reverse:function () {\n var action = new cc.SkewBy(this._duration, -this._skewX, -this._skewY);\n this._cloneDecoration(action);\n this._reverseEaseList(action);\n return action;\n }\n});\n\n/**\n * !#en\n * Skews a Node object by skewX and skewY degrees.
\n * Relative to its property modification.\n * !#zh 偏斜指定的角度。\n * @method skewBy\n * @param {Number} t time in seconds\n * @param {Number} sx sx skew in degrees for X axis\n * @param {Number} sy sy skew in degrees for Y axis\n * @return {ActionInterval}\n * @example\n * // example\n * var actionBy = cc.skewBy(2, 0, -90);\n */\ncc.skewBy = function (t, sx, sy) {\n return new cc.SkewBy(t, sx, sy);\n};\n\n\n/*\n * Moves a Node object simulating a parabolic jump movement by modifying its position property.\n * Relative to its movement.\n * @class JumpBy\n * @extends ActionInterval\n * @param {Number} duration\n * @param {Vec2|Number} position\n * @param {Number} [y]\n * @param {Number} height\n * @param {Number} jumps\n * @example\n * var actionBy = new cc.JumpBy(2, cc.v2(300, 0), 50, 4);\n * var actionBy = new cc.JumpBy(2, 300, 0, 50, 4);\n */\ncc.JumpBy = cc.Class({\n name: 'cc.JumpBy',\n extends: cc.ActionInterval,\n\n ctor:function (duration, position, y, height, jumps) {\n this._startPosition = cc.v2(0, 0);\n this._previousPosition = cc.v2(0, 0);\n this._delta = cc.v2(0, 0);\n this._height = 0;\n this._jumps = 0;\n\n height !== undefined && cc.JumpBy.prototype.initWithDuration.call(this, duration, position, y, height, jumps);\n },\n /*\n * Initializes the action.\n * @param {Number} duration\n * @param {Vec2|Number} position\n * @param {Number} [y]\n * @param {Number} height\n * @param {Number} jumps\n * @return {Boolean}\n * @example\n * actionBy.initWithDuration(2, cc.v2(300, 0), 50, 4);\n * actionBy.initWithDuration(2, 300, 0, 50, 4);\n */\n initWithDuration:function (duration, position, y, height, jumps) {\n if (cc.ActionInterval.prototype.initWithDuration.call(this, duration)) {\n\t if (jumps === undefined) {\n\t\t jumps = height;\n\t\t height = y;\n\t\t y = position.y;\n\t\t position = position.x;\n\t }\n this._delta.x = position;\n this._delta.y = y;\n this._height = height;\n this._jumps = jumps;\n return true;\n }\n return false;\n },\n\n clone:function () {\n var action = new cc.JumpBy();\n this._cloneDecoration(action);\n action.initWithDuration(this._duration, this._delta, this._height, this._jumps);\n return action;\n },\n\n startWithTarget:function (target) {\n cc.ActionInterval.prototype.startWithTarget.call(this, target);\n var locPosX = target.x;\n var locPosY = target.y;\n this._previousPosition.x = locPosX;\n this._previousPosition.y = locPosY;\n this._startPosition.x = locPosX;\n this._startPosition.y = locPosY;\n },\n\n update:function (dt) {\n dt = this._computeEaseTime(dt);\n if (this.target) {\n var frac = dt * this._jumps % 1.0;\n var y = this._height * 4 * frac * (1 - frac);\n y += this._delta.y * dt;\n\n var x = this._delta.x * dt;\n var locStartPosition = this._startPosition;\n if (cc.macro.ENABLE_STACKABLE_ACTIONS) {\n var targetX = this.target.x;\n var targetY = this.target.y;\n var locPreviousPosition = this._previousPosition;\n\n locStartPosition.x = locStartPosition.x + targetX - locPreviousPosition.x;\n locStartPosition.y = locStartPosition.y + targetY - locPreviousPosition.y;\n x = x + locStartPosition.x;\n y = y + locStartPosition.y;\n\t locPreviousPosition.x = x;\n\t locPreviousPosition.y = y;\n\t this.target.setPosition(x, y);\n } else {\n this.target.setPosition(locStartPosition.x + x, locStartPosition.y + y);\n }\n }\n },\n\n reverse:function () {\n var action = new cc.JumpBy(this._duration, cc.v2(-this._delta.x, -this._delta.y), this._height, this._jumps);\n this._cloneDecoration(action);\n this._reverseEaseList(action);\n return action;\n }\n});\n\n/**\n * !#en\n * Moves a Node object simulating a parabolic jump movement by modifying it's position property.\n * Relative to its movement.\n * !#zh 用跳跃的方式移动指定的距离。\n * @method jumpBy\n * @param {Number} duration\n * @param {Vec2|Number} position\n * @param {Number} [y]\n * @param {Number} [height]\n * @param {Number} [jumps]\n * @return {ActionInterval}\n * @example\n * // example\n * var actionBy = cc.jumpBy(2, cc.v2(300, 0), 50, 4);\n * var actionBy = cc.jumpBy(2, 300, 0, 50, 4);\n */\ncc.jumpBy = function (duration, position, y, height, jumps) {\n return new cc.JumpBy(duration, position, y, height, jumps);\n};\n\n/*\n * Moves a Node object to a parabolic position simulating a jump movement by modifying it's position property.
\n * Jump to the specified location.\n * @class JumpTo\n * @extends JumpBy\n * @param {Number} duration\n * @param {Vec2|Number} position\n * @param {Number} [y]\n * @param {Number} [height]\n * @param {Number} [jumps]\n * @example\n * var actionTo = new cc.JumpTo(2, cc.v2(300, 0), 50, 4);\n * var actionTo = new cc.JumpTo(2, 300, 0, 50, 4);\n */\ncc.JumpTo = cc.Class({\n name: 'cc.JumpTo',\n extends: cc.JumpBy,\n\n ctor:function (duration, position, y, height, jumps) {\n this._endPosition = cc.v2(0, 0);\n height !== undefined && this.initWithDuration(duration, position, y, height, jumps);\n },\n /*\n * Initializes the action.\n * @param {Number} duration\n * @param {Vec2|Number} position\n * @param {Number} [y]\n * @param {Number} height\n * @param {Number} jumps\n * @return {Boolean}\n * @example\n * actionTo.initWithDuration(2, cc.v2(300, 0), 50, 4);\n * actionTo.initWithDuration(2, 300, 0, 50, 4);\n */\n initWithDuration:function (duration, position, y, height, jumps) {\n if (cc.JumpBy.prototype.initWithDuration.call(this, duration, position, y, height, jumps)) {\n if (jumps === undefined) {\n y = position.y;\n position = position.x;\n }\n this._endPosition.x = position;\n this._endPosition.y = y;\n return true;\n }\n return false;\n },\n\n startWithTarget:function (target) {\n cc.JumpBy.prototype.startWithTarget.call(this, target);\n this._delta.x = this._endPosition.x - this._startPosition.x;\n this._delta.y = this._endPosition.y - this._startPosition.y;\n },\n\n clone:function () {\n var action = new cc.JumpTo();\n this._cloneDecoration(action);\n action.initWithDuration(this._duration, this._endPosition, this._height, this._jumps);\n return action;\n }\n});\n\n/**\n * !#en\n * Moves a Node object to a parabolic position simulating a jump movement by modifying its position property.
\n * Jump to the specified location.\n * !#zh 用跳跃的方式移动到目标位置。\n * @method jumpTo\n * @param {Number} duration\n * @param {Vec2|Number} position\n * @param {Number} [y]\n * @param {Number} [height]\n * @param {Number} [jumps]\n * @return {ActionInterval}\n * @example\n * // example\n * var actionTo = cc.jumpTo(2, cc.v2(300, 300), 50, 4);\n * var actionTo = cc.jumpTo(2, 300, 300, 50, 4);\n */\ncc.jumpTo = function (duration, position, y, height, jumps) {\n return new cc.JumpTo(duration, position, y, height, jumps);\n};\n\n/* An action that moves the target with a cubic Bezier curve by a certain distance.\n * Relative to its movement.\n * @class BezierBy\n * @extends ActionInterval\n * @param {Number} t - time in seconds\n * @param {Vec2[]} c - Array of points\n * @example\n * var bezier = [cc.v2(0, windowSize.height / 2), cc.v2(300, -windowSize.height / 2), cc.v2(300, 100)];\n * var bezierForward = new cc.BezierBy(3, bezier);\n */\nfunction bezierAt (a, b, c, d, t) {\n return (Math.pow(1 - t, 3) * a +\n 3 * t * (Math.pow(1 - t, 2)) * b +\n 3 * Math.pow(t, 2) * (1 - t) * c +\n Math.pow(t, 3) * d );\n};\ncc.BezierBy = cc.Class({\n name: 'cc.BezierBy',\n extends: cc.ActionInterval,\n\n ctor:function (t, c) {\n this._config = [];\n this._startPosition = cc.v2(0, 0);\n this._previousPosition = cc.v2(0, 0);\n c && cc.BezierBy.prototype.initWithDuration.call(this, t, c);\n },\n\n /*\n * Initializes the action.\n * @param {Number} t - time in seconds\n * @param {Vec2[]} c - Array of points\n * @return {Boolean}\n */\n initWithDuration:function (t, c) {\n if (cc.ActionInterval.prototype.initWithDuration.call(this, t)) {\n this._config = c;\n return true;\n }\n return false;\n },\n\n clone:function () {\n var action = new cc.BezierBy();\n this._cloneDecoration(action);\n var newConfigs = [];\n for (var i = 0; i < this._config.length; i++) {\n var selConf = this._config[i];\n newConfigs.push(cc.v2(selConf.x, selConf.y));\n }\n action.initWithDuration(this._duration, newConfigs);\n return action;\n },\n\n startWithTarget:function (target) {\n cc.ActionInterval.prototype.startWithTarget.call(this, target);\n var locPosX = target.x;\n var locPosY = target.y;\n this._previousPosition.x = locPosX;\n this._previousPosition.y = locPosY;\n this._startPosition.x = locPosX;\n this._startPosition.y = locPosY;\n },\n\n update:function (dt) {\n dt = this._computeEaseTime(dt);\n if (this.target) {\n var locConfig = this._config;\n var xa = 0;\n var xb = locConfig[0].x;\n var xc = locConfig[1].x;\n var xd = locConfig[2].x;\n\n var ya = 0;\n var yb = locConfig[0].y;\n var yc = locConfig[1].y;\n var yd = locConfig[2].y;\n\n var x = bezierAt(xa, xb, xc, xd, dt);\n var y = bezierAt(ya, yb, yc, yd, dt);\n\n var locStartPosition = this._startPosition;\n if (cc.macro.ENABLE_STACKABLE_ACTIONS) {\n var targetX = this.target.x;\n var targetY = this.target.y;\n var locPreviousPosition = this._previousPosition;\n\n locStartPosition.x = locStartPosition.x + targetX - locPreviousPosition.x;\n locStartPosition.y = locStartPosition.y + targetY - locPreviousPosition.y;\n x = x + locStartPosition.x;\n y = y + locStartPosition.y;\n\t locPreviousPosition.x = x;\n\t locPreviousPosition.y = y;\n\t this.target.setPosition(x, y);\n } else {\n this.target.setPosition(locStartPosition.x + x, locStartPosition.y + y);\n }\n }\n },\n\n reverse:function () {\n var locConfig = this._config;\n var x0 = locConfig[0].x, y0 = locConfig[0].y;\n var x1 = locConfig[1].x, y1 = locConfig[1].y;\n var x2 = locConfig[2].x, y2 = locConfig[2].y;\n var r = [\n cc.v2(x1 - x2, y1 - y2),\n cc.v2(x0 - x2, y0 - y2),\n cc.v2(-x2, -y2) ];\n var action = new cc.BezierBy(this._duration, r);\n this._cloneDecoration(action);\n this._reverseEaseList(action);\n return action;\n }\n});\n\n/**\n * !#en\n * An action that moves the target with a cubic Bezier curve by a certain distance.\n * Relative to its movement.\n * !#zh 按贝赛尔曲线轨迹移动指定的距离。\n * @method bezierBy\n * @param {Number} t - time in seconds\n * @param {Vec2[]} c - Array of points\n * @return {ActionInterval}\n * @example\n * // example\n * var bezier = [cc.v2(0, windowSize.height / 2), cc.v2(300, -windowSize.height / 2), cc.v2(300, 100)];\n * var bezierForward = cc.bezierBy(3, bezier);\n */\ncc.bezierBy = function (t, c) {\n return new cc.BezierBy(t, c);\n};\n\n\n/* An action that moves the target with a cubic Bezier curve to a destination point.\n * @class BezierTo\n * @extends BezierBy\n * @param {Number} t\n * @param {Vec2[]} c - Array of points\n * @example\n * var bezier = [cc.v2(0, windowSize.height / 2), cc.v2(300, -windowSize.height / 2), cc.v2(300, 100)];\n * var bezierTo = new cc.BezierTo(2, bezier);\n */\ncc.BezierTo = cc.Class({\n name: 'cc.BezierTo',\n extends: cc.BezierBy,\n\n ctor:function (t, c) {\n this._toConfig = [];\n\t\tc && this.initWithDuration(t, c);\n },\n\n /*\n * Initializes the action.\n * @param {Number} t time in seconds\n * @param {Vec2[]} c - Array of points\n * @return {Boolean}\n */\n initWithDuration:function (t, c) {\n if (cc.ActionInterval.prototype.initWithDuration.call(this, t)) {\n this._toConfig = c;\n return true;\n }\n return false;\n },\n\n clone:function () {\n var action = new cc.BezierTo();\n this._cloneDecoration(action);\n action.initWithDuration(this._duration, this._toConfig);\n return action;\n },\n\n startWithTarget:function (target) {\n cc.BezierBy.prototype.startWithTarget.call(this, target);\n var locStartPos = this._startPosition;\n var locToConfig = this._toConfig;\n var locConfig = this._config;\n\n locConfig[0] = locToConfig[0].sub(locStartPos);\n locConfig[1] = locToConfig[1].sub(locStartPos);\n locConfig[2] = locToConfig[2].sub(locStartPos);\n }\n});\n/**\n * !#en An action that moves the target with a cubic Bezier curve to a destination point.\n * !#zh 按贝赛尔曲线轨迹移动到目标位置。\n * @method bezierTo\n * @param {Number} t\n * @param {Vec2[]} c - Array of points\n * @return {ActionInterval}\n * @example\n * // example\n * var bezier = [cc.v2(0, windowSize.height / 2), cc.v2(300, -windowSize.height / 2), cc.v2(300, 100)];\n * var bezierTo = cc.bezierTo(2, bezier);\n */\ncc.bezierTo = function (t, c) {\n return new cc.BezierTo(t, c);\n};\n\n\n/* Scales a Node object to a zoom factor by modifying it's scale property.\n * @warning This action doesn't support \"reverse\"\n * @class ScaleTo\n * @extends ActionInterval\n * @param {Number} duration\n * @param {Number} sx scale parameter in X\n * @param {Number} [sy] scale parameter in Y, if Null equal to sx\n * @example\n * // It scales to 0.5 in both X and Y.\n * var actionTo = new cc.ScaleTo(2, 0.5);\n *\n * // It scales to 0.5 in x and 2 in Y\n * var actionTo = new cc.ScaleTo(2, 0.5, 2);\n */\ncc.ScaleTo = cc.Class({\n name: 'cc.ScaleTo',\n extends: cc.ActionInterval,\n\n ctor:function (duration, sx, sy) {\n this._scaleX = 1;\n this._scaleY = 1;\n this._startScaleX = 1;\n this._startScaleY = 1;\n this._endScaleX = 0;\n this._endScaleY = 0;\n this._deltaX = 0;\n this._deltaY = 0;\n sx !== undefined && cc.ScaleTo.prototype.initWithDuration.call(this, duration, sx, sy);\n },\n\n /*\n * Initializes the action.\n * @param {Number} duration\n * @param {Number} sx\n * @param {Number} [sy=]\n * @return {Boolean}\n */\n initWithDuration:function (duration, sx, sy) { //function overload here\n if (cc.ActionInterval.prototype.initWithDuration.call(this, duration)) {\n this._endScaleX = sx;\n this._endScaleY = (sy != null) ? sy : sx;\n return true;\n }\n return false;\n },\n\n clone:function () {\n var action = new cc.ScaleTo();\n this._cloneDecoration(action);\n action.initWithDuration(this._duration, this._endScaleX, this._endScaleY);\n return action;\n },\n\n startWithTarget:function (target) {\n cc.ActionInterval.prototype.startWithTarget.call(this, target);\n this._startScaleX = target.scaleX;\n this._startScaleY = target.scaleY;\n this._deltaX = this._endScaleX - this._startScaleX;\n this._deltaY = this._endScaleY - this._startScaleY;\n },\n\n update:function (dt) {\n dt = this._computeEaseTime(dt);\n if (this.target) {\n this.target.scaleX = this._startScaleX + this._deltaX * dt;\n\t this.target.scaleY = this._startScaleY + this._deltaY * dt;\n }\n }\n});\n/**\n * !#en Scales a Node object to a zoom factor by modifying it's scale property.\n * !#zh 将节点大小缩放到指定的倍数。\n * @method scaleTo\n * @param {Number} duration\n * @param {Number} sx scale parameter in X\n * @param {Number} [sy] scale parameter in Y, if Null equal to sx\n * @return {ActionInterval}\n * @example\n * // example\n * // It scales to 0.5 in both X and Y.\n * var actionTo = cc.scaleTo(2, 0.5);\n *\n * // It scales to 0.5 in x and 2 in Y\n * var actionTo = cc.scaleTo(2, 0.5, 2);\n */\ncc.scaleTo = function (duration, sx, sy) { //function overload\n return new cc.ScaleTo(duration, sx, sy);\n};\n\n\n/* Scales a Node object a zoom factor by modifying it's scale property.\n * Relative to its changes.\n * @class ScaleBy\n * @extends ScaleTo\n */\ncc.ScaleBy = cc.Class({\n name: 'cc.ScaleBy',\n extends: cc.ScaleTo,\n\n startWithTarget:function (target) {\n cc.ScaleTo.prototype.startWithTarget.call(this, target);\n this._deltaX = this._startScaleX * this._endScaleX - this._startScaleX;\n this._deltaY = this._startScaleY * this._endScaleY - this._startScaleY;\n },\n\n reverse:function () {\n var action = new cc.ScaleBy(this._duration, 1 / this._endScaleX, 1 / this._endScaleY);\n this._cloneDecoration(action);\n this._reverseEaseList(action);\n return action;\n },\n\n clone:function () {\n var action = new cc.ScaleBy();\n this._cloneDecoration(action);\n action.initWithDuration(this._duration, this._endScaleX, this._endScaleY);\n return action;\n }\n});\n/**\n * !#en\n * Scales a Node object a zoom factor by modifying it's scale property.\n * Relative to its changes.\n * !#zh 按指定的倍数缩放节点大小。\n * @method scaleBy\n * @param {Number} duration duration in seconds\n * @param {Number} sx sx scale parameter in X\n * @param {Number|Null} [sy=] sy scale parameter in Y, if Null equal to sx\n * @return {ActionInterval}\n * @example\n * // example without sy, it scales by 2 both in X and Y\n * var actionBy = cc.scaleBy(2, 2);\n *\n * //example with sy, it scales by 0.25 in X and 4.5 in Y\n * var actionBy2 = cc.scaleBy(2, 0.25, 4.5);\n */\ncc.scaleBy = function (duration, sx, sy) {\n return new cc.ScaleBy(duration, sx, sy);\n};\n\n/* Blinks a Node object by modifying it's visible property\n * @class Blink\n * @extends ActionInterval\n * @param {Number} duration duration in seconds\n * @param {Number} blinks blinks in times\n * @example\n * var action = new cc.Blink(2, 10);\n */\ncc.Blink = cc.Class({\n name: 'cc.Blink',\n extends: cc.ActionInterval,\n\n ctor:function (duration, blinks) {\n this._times = 0;\n this._originalState = false;\n\t\tblinks !== undefined && this.initWithDuration(duration, blinks);\n },\n\n /*\n * Initializes the action.\n * @param {Number} duration duration in seconds\n * @param {Number} blinks blinks in times\n * @return {Boolean}\n */\n initWithDuration:function (duration, blinks) {\n if (cc.ActionInterval.prototype.initWithDuration.call(this, duration)) {\n this._times = blinks;\n return true;\n }\n return false;\n },\n\n clone:function () {\n var action = new cc.Blink();\n this._cloneDecoration(action);\n action.initWithDuration(this._duration, this._times);\n return action;\n },\n\n update:function (dt) {\n dt = this._computeEaseTime(dt);\n if (this.target && !this.isDone()) {\n var slice = 1.0 / this._times;\n var m = dt % slice;\n this.target.opacity = (m > (slice / 2)) ? 255 : 0;\n }\n },\n\n startWithTarget:function (target) {\n cc.ActionInterval.prototype.startWithTarget.call(this, target);\n this._originalState = target.opacity;\n },\n\n stop:function () {\n this.target.opacity = this._originalState;\n cc.ActionInterval.prototype.stop.call(this);\n },\n\n reverse:function () {\n var action = new cc.Blink(this._duration, this._times);\n this._cloneDecoration(action);\n this._reverseEaseList(action);\n return action;\n }\n});\n/**\n * !#en Blinks a Node object by modifying it's visible property.\n * !#zh 闪烁(基于透明度)。\n * @method blink\n * @param {Number} duration duration in seconds\n * @param {Number} blinks blinks in times\n * @return {ActionInterval}\n * @example\n * // example\n * var action = cc.blink(2, 10);\n */\ncc.blink = function (duration, blinks) {\n return new cc.Blink(duration, blinks);\n};\n\n/* Fades an object that implements the cc.RGBAProtocol protocol. It modifies the opacity from the current value to a custom one.\n * @warning This action doesn't support \"reverse\"\n * @class FadeTo\n * @extends ActionInterval\n * @param {Number} duration\n * @param {Number} opacity 0-255, 0 is transparent\n * @example\n * var action = new cc.FadeTo(1.0, 0);\n */\ncc.FadeTo = cc.Class({\n name: 'cc.FadeTo',\n extends: cc.ActionInterval,\n\n ctor:function (duration, opacity) {\n this._toOpacity = 0;\n this._fromOpacity = 0;\n opacity !== undefined && cc.FadeTo.prototype.initWithDuration.call(this, duration, opacity);\n },\n\n /*\n * Initializes the action.\n * @param {Number} duration duration in seconds\n * @param {Number} opacity\n * @return {Boolean}\n */\n initWithDuration:function (duration, opacity) {\n if (cc.ActionInterval.prototype.initWithDuration.call(this, duration)) {\n this._toOpacity = opacity;\n return true;\n }\n return false;\n },\n\n clone:function () {\n var action = new cc.FadeTo();\n this._cloneDecoration(action);\n action.initWithDuration(this._duration, this._toOpacity);\n return action;\n },\n\n update:function (time) {\n time = this._computeEaseTime(time);\n var fromOpacity = this._fromOpacity !== undefined ? this._fromOpacity : 255;\n this.target.opacity = fromOpacity + (this._toOpacity - fromOpacity) * time;\n },\n\n startWithTarget:function (target) {\n cc.ActionInterval.prototype.startWithTarget.call(this, target);\n this._fromOpacity = target.opacity;\n }\n});\n\n/**\n * !#en\n * Fades an object that implements the cc.RGBAProtocol protocol.\n * It modifies the opacity from the current value to a custom one.\n * !#zh 修改透明度到指定值。\n * @method fadeTo\n * @param {Number} duration\n * @param {Number} opacity 0-255, 0 is transparent\n * @return {ActionInterval}\n * @example\n * // example\n * var action = cc.fadeTo(1.0, 0);\n */\ncc.fadeTo = function (duration, opacity) {\n return new cc.FadeTo(duration, opacity);\n};\n\n/* Fades In an object that implements the cc.RGBAProtocol protocol. It modifies the opacity from 0 to 255.
\n * The \"reverse\" of this action is FadeOut\n * @class FadeIn\n * @extends FadeTo\n * @param {Number} duration duration in seconds\n */\ncc.FadeIn = cc.Class({\n name: 'cc.FadeIn',\n extends: cc.FadeTo,\n\n ctor:function (duration) {\n if (duration == null)\n duration = 0;\n this._reverseAction = null;\n this.initWithDuration(duration, 255);\n },\n\n reverse:function () {\n var action = new cc.FadeOut();\n action.initWithDuration(this._duration, 0);\n this._cloneDecoration(action);\n this._reverseEaseList(action);\n return action;\n },\n\n clone:function () {\n var action = new cc.FadeIn();\n this._cloneDecoration(action);\n action.initWithDuration(this._duration, this._toOpacity);\n return action;\n },\n\n startWithTarget:function (target) {\n if(this._reverseAction)\n this._toOpacity = this._reverseAction._fromOpacity;\n cc.FadeTo.prototype.startWithTarget.call(this, target);\n }\n});\n\n/**\n * !#en Fades In an object that implements the cc.RGBAProtocol protocol. It modifies the opacity from 0 to 255.\n * !#zh 渐显效果。\n * @method fadeIn\n * @param {Number} duration duration in seconds\n * @return {ActionInterval}\n * @example\n * //example\n * var action = cc.fadeIn(1.0);\n */\ncc.fadeIn = function (duration) {\n return new cc.FadeIn(duration);\n};\n\n\n/* Fades Out an object that implements the cc.RGBAProtocol protocol. It modifies the opacity from 255 to 0.\n * The \"reverse\" of this action is FadeIn\n * @class FadeOut\n * @extends FadeTo\n * @param {Number} duration duration in seconds\n */\ncc.FadeOut = cc.Class({\n name: 'cc.FadeOut',\n extends: cc.FadeTo,\n\n ctor:function (duration) {\n if (duration == null)\n duration = 0;\n this._reverseAction = null;\n this.initWithDuration(duration, 0);\n },\n\n reverse:function () {\n var action = new cc.FadeIn();\n action._reverseAction = this;\n action.initWithDuration(this._duration, 255);\n this._cloneDecoration(action);\n this._reverseEaseList(action);\n return action;\n },\n\n clone:function () {\n var action = new cc.FadeOut();\n this._cloneDecoration(action);\n action.initWithDuration(this._duration, this._toOpacity);\n return action;\n }\n});\n\n/**\n * !#en Fades Out an object that implements the cc.RGBAProtocol protocol. It modifies the opacity from 255 to 0.\n * !#zh 渐隐效果。\n * @method fadeOut\n * @param {Number} d duration in seconds\n * @return {ActionInterval}\n * @example\n * // example\n * var action = cc.fadeOut(1.0);\n */\ncc.fadeOut = function (d) {\n return new cc.FadeOut(d);\n};\n\n/* Tints a Node that implements the cc.NodeRGB protocol from current tint to a custom one.\n * @warning This action doesn't support \"reverse\"\n * @class TintTo\n * @extends ActionInterval\n * @param {Number} duration\n * @param {Number} red 0-255\n * @param {Number} green 0-255\n * @param {Number} blue 0-255\n * @example\n * var action = new cc.TintTo(2, 255, 0, 255);\n */\ncc.TintTo = cc.Class({\n name: 'cc.TintTo',\n extends: cc.ActionInterval,\n\n ctor:function (duration, red, green, blue) {\n this._to = cc.color(0, 0, 0);\n this._from = cc.color(0, 0, 0);\n\n if (red instanceof cc.Color) {\n blue = red.b;\n green = red.g;\n red = red.r;\n }\n\n blue !== undefined && this.initWithDuration(duration, red, green, blue);\n },\n\n /*\n * Initializes the action.\n * @param {Number} duration\n * @param {Number} red 0-255\n * @param {Number} green 0-255\n * @param {Number} blue 0-255\n * @return {Boolean}\n */\n initWithDuration:function (duration, red, green, blue) {\n if (cc.ActionInterval.prototype.initWithDuration.call(this, duration)) {\n this._to = cc.color(red, green, blue);\n return true;\n }\n return false;\n },\n\n clone:function () {\n var action = new cc.TintTo();\n this._cloneDecoration(action);\n var locTo = this._to;\n action.initWithDuration(this._duration, locTo.r, locTo.g, locTo.b);\n return action;\n },\n\n startWithTarget:function (target) {\n cc.ActionInterval.prototype.startWithTarget.call(this, target);\n\n this._from = this.target.color;\n },\n\n update:function (dt) {\n dt = this._computeEaseTime(dt);\n var locFrom = this._from, locTo = this._to;\n if (locFrom) {\n this.target.color = cc.color(\n locFrom.r + (locTo.r - locFrom.r) * dt,\n locFrom.g + (locTo.g - locFrom.g) * dt,\n locFrom.b + (locTo.b - locFrom.b) * dt);\n }\n }\n});\n\n/**\n * !#en Tints a Node that implements the cc.NodeRGB protocol from current tint to a custom one.\n * !#zh 修改颜色到指定值。\n * @method tintTo\n * @param {Number} duration\n * @param {Number} red 0-255\n * @param {Number} green 0-255\n * @param {Number} blue 0-255\n * @return {ActionInterval}\n * @example\n * // example\n * var action = cc.tintTo(2, 255, 0, 255);\n */\ncc.tintTo = function (duration, red, green, blue) {\n return new cc.TintTo(duration, red, green, blue);\n};\n\n\n/* Tints a Node that implements the cc.NodeRGB protocol from current tint to a custom one.\n * Relative to their own color change.\n * @class TintBy\n * @extends ActionInterval\n * @param {Number} duration duration in seconds\n * @param {Number} deltaRed\n * @param {Number} deltaGreen\n * @param {Number} deltaBlue\n * @example\n * var action = new cc.TintBy(2, -127, -255, -127);\n */\ncc.TintBy = cc.Class({\n name: 'cc.TintBy',\n extends: cc.ActionInterval,\n\n ctor:function (duration, deltaRed, deltaGreen, deltaBlue) {\n this._deltaR = 0;\n this._deltaG = 0;\n this._deltaB = 0;\n this._fromR = 0;\n this._fromG = 0;\n this._fromB = 0;\n\t\tdeltaBlue !== undefined && this.initWithDuration(duration, deltaRed, deltaGreen, deltaBlue);\n },\n\n /*\n * Initializes the action.\n * @param {Number} duration\n * @param {Number} deltaRed 0-255\n * @param {Number} deltaGreen 0-255\n * @param {Number} deltaBlue 0-255\n * @return {Boolean}\n */\n initWithDuration:function (duration, deltaRed, deltaGreen, deltaBlue) {\n if (cc.ActionInterval.prototype.initWithDuration.call(this, duration)) {\n this._deltaR = deltaRed;\n this._deltaG = deltaGreen;\n this._deltaB = deltaBlue;\n return true;\n }\n return false;\n },\n\n clone:function () {\n var action = new cc.TintBy();\n this._cloneDecoration(action);\n action.initWithDuration(this._duration, this._deltaR, this._deltaG, this._deltaB);\n return action;\n },\n\n startWithTarget:function (target) {\n cc.ActionInterval.prototype.startWithTarget.call(this, target);\n\n var color = target.color;\n this._fromR = color.r;\n this._fromG = color.g;\n this._fromB = color.b;\n },\n\n update:function (dt) {\n dt = this._computeEaseTime(dt);\n\n this.target.color = cc.color(this._fromR + this._deltaR * dt,\n this._fromG + this._deltaG * dt,\n this._fromB + this._deltaB * dt);\n },\n\n reverse:function () {\n var action = new cc.TintBy(this._duration, -this._deltaR, -this._deltaG, -this._deltaB);\n this._cloneDecoration(action);\n this._reverseEaseList(action);\n return action;\n }\n});\n\n/**\n * !#en\n * Tints a Node that implements the cc.NodeRGB protocol from current tint to a custom one.\n * Relative to their own color change.\n * !#zh 按照指定的增量修改颜色。\n * @method tintBy\n * @param {Number} duration duration in seconds\n * @param {Number} deltaRed\n * @param {Number} deltaGreen\n * @param {Number} deltaBlue\n * @return {ActionInterval}\n * @example\n * // example\n * var action = cc.tintBy(2, -127, -255, -127);\n */\ncc.tintBy = function (duration, deltaRed, deltaGreen, deltaBlue) {\n return new cc.TintBy(duration, deltaRed, deltaGreen, deltaBlue);\n};\n\n/* Delays the action a certain amount of seconds\n * @class DelayTime\n * @extends ActionInterval\n */\ncc.DelayTime = cc.Class({\n name: 'cc.DelayTime',\n extends: cc.ActionInterval,\n\n update:function (dt) {},\n\n reverse:function () {\n var action = new cc.DelayTime(this._duration);\n this._cloneDecoration(action);\n this._reverseEaseList(action);\n return action;\n },\n\n clone:function () {\n var action = new cc.DelayTime();\n this._cloneDecoration(action);\n action.initWithDuration(this._duration);\n return action;\n }\n});\n\n/**\n * !#en Delays the action a certain amount of seconds.\n * !#zh 延迟指定的时间量。\n * @method delayTime\n * @param {Number} d duration in seconds\n * @return {ActionInterval}\n * @example\n * // example\n * var delay = cc.delayTime(1);\n */\ncc.delayTime = function (d) {\n return new cc.DelayTime(d);\n};\n\n/*\n *
\n * @warning Use this action carefully. This action is not sequenceable.
\n * Use it as the default \"reversed\" method of your own actions, but using it outside the \"reversed\"
\n * scope is not recommended.\n *
\n * specified at action creation rather than the one specified by runAction.\n *
\n * Normally you won't need to use this class directly. 99% of the cases you will use the CCNode interface,\n * which uses this class's singleton object.\n * But there are some cases where you might need to use this class.
\n * Examples:
\n * - When you want to run an action where the target is different from a CCNode.
\n * - When you want to pause / resume the actions
\n * !#zh\n * cc.ActionManager 是可以管理动作的单例类。
\n * 通常你并不需要直接使用这个类,99%的情况您将使用 CCNode 的接口。
\n * 但也有一些情况下,您可能需要使用这个类。
\n * 例如:\n * - 当你想要运行一个动作,但目标不是 CCNode 类型时。
\n * - 当你想要暂停/恢复动作时。
\n * @class ActionManager\n * @example {@link cocos2d/core/CCActionManager/ActionManager.js}\n */\ncc.ActionManager = function () {\n this._hashTargets = js.createMap(true);\n this._arrayTargets = [];\n this._currentTarget = null;\n cc.director._scheduler && cc.director._scheduler.enableForTarget(this);\n};\ncc.ActionManager.prototype = {\n constructor: cc.ActionManager,\n _elementPool: [],\n\n _searchElementByTarget: function (arr, target) {\n for (var k = 0; k < arr.length; k++) {\n if (target === arr[k].target)\n return arr[k];\n }\n return null;\n },\n\n _getElement: function (target, paused) {\n var element = this._elementPool.pop();\n if (!element) {\n element = new HashElement();\n }\n element.target = target;\n element.paused = !!paused;\n return element;\n },\n\n _putElement: function (element) {\n element.actions.length = 0;\n element.actionIndex = 0;\n element.currentAction = null;\n element.paused = false;\n element.target = null;\n element.lock = false;\n this._elementPool.push(element);\n },\n\n /**\n * !#en\n * Adds an action with a target.
\n * If the target is already present, then the action will be added to the existing target.\n * If the target is not present, a new instance of this target will be created either paused or not, and the action will be added to the newly created target.\n * When the target is paused, the queued actions won't be 'ticked'.\n * !#zh\n * 增加一个动作,同时还需要提供动作的目标对象,目标对象是否暂停作为参数。
\n * 如果目标已存在,动作将会被直接添加到现有的节点中。
\n * 如果目标不存在,将为这一目标创建一个新的实例,并将动作添加进去。
\n * 当目标状态的 paused 为 true,动作将不会被执行\n *\n * @method addAction\n * @param {Action} action\n * @param {Node} target\n * @param {Boolean} paused\n */\n addAction: function (action, target, paused) {\n if (!action || !target) {\n cc.errorID(1000);\n return;\n }\n\n //check if the action target already exists\n var element = this._hashTargets[target._id];\n //if doesn't exists, create a hashelement and push in mpTargets\n if (!element) {\n element = this._getElement(target, paused);\n this._hashTargets[target._id] = element;\n this._arrayTargets.push(element);\n }\n else if (!element.actions) {\n element.actions = [];\n }\n\n element.actions.push(action);\n action.startWithTarget(target);\n },\n\n /**\n * !#en Removes all actions from all the targets.\n * !#zh 移除所有对象的所有动作。\n * @method removeAllActions\n */\n removeAllActions: function () {\n var locTargets = this._arrayTargets;\n for (var i = 0; i < locTargets.length; i++) {\n var element = locTargets[i];\n if (element)\n this._putElement(element);\n }\n this._arrayTargets.length = 0;\n this._hashTargets = js.createMap(true);\n },\n /**\n * !#en\n * Removes all actions from a certain target.
\n * All the actions that belongs to the target will be removed.\n * !#zh\n * 移除指定对象上的所有动作。
\n * 属于该目标的所有的动作将被删除。\n * @method removeAllActionsFromTarget\n * @param {Node} target\n * @param {Boolean} forceDelete\n */\n removeAllActionsFromTarget: function (target, forceDelete) {\n // explicit null handling\n if (target == null)\n return;\n var element = this._hashTargets[target._id];\n if (element) {\n element.actions.length = 0;\n this._deleteHashElement(element);\n }\n },\n /**\n * !#en Removes an action given an action reference.\n * !#zh 移除指定的动作。\n * @method removeAction \n * @param {Action} action\n */\n removeAction: function (action) {\n // explicit null handling\n if (!action) {\n return;\n }\n var target = action.getOriginalTarget();\n var element = this._hashTargets[target._id];\n\n if (!element) {\n return;\n }\n\n for (var i = 0; i < element.actions.length; i++) {\n if (element.actions[i] === action) {\n element.actions.splice(i, 1);\n // update actionIndex in case we are in tick. looping over the actions\n if (element.actionIndex >= i)\n element.actionIndex--;\n break;\n }\n }\n },\n\n /**\n * @internal\n */\n _removeActionByTag (tag, element, target) {\n for (var i = 0, l = element.actions.length; i < l; ++i) {\n var action = element.actions[i];\n if (action && action.getTag() === tag) {\n if (target && action.getOriginalTarget() !== target) {\n continue;\n }\n this._removeActionAtIndex(i, element);\n break;\n }\n }\n },\n\n /**\n * @internal\n */\n _removeAllActionsByTag (tag, element, target) {\n for (var i = element.actions.length - 1; i >= 0; --i) {\n var action = element.actions[i];\n if (action && action.getTag() === tag) {\n if (target && action.getOriginalTarget() !== target) {\n continue;\n }\n this._removeActionAtIndex(i, element);\n }\n }\n },\n\n /**\n * !#en Removes an action given its tag and the target.\n * !#zh 删除指定对象下特定标签的一个动作,将删除首个匹配到的动作。\n * @method removeActionByTag\n * @param {Number} tag\n * @param {Node} [target]\n */\n removeActionByTag: function (tag, target) {\n if(tag === cc.Action.TAG_INVALID)\n cc.logID(1002);\n\n let hashTargets = this._hashTargets;\n if (target) {\n var element = hashTargets[target._id];\n if (element) {\n this._removeActionByTag(tag, element, target);\n }\n }\n else {\n for (let name in hashTargets) {\n let element = hashTargets[name];\n this._removeActionByTag(tag, element);\n }\n }\n },\n\n /**\n * !#en Removes all actions given the tag and the target.\n * !#zh 删除指定对象下特定标签的所有动作。\n * @method removeAllActionsByTag\n * @param {Number} tag\n * @param {Node} [target]\n */\n removeAllActionsByTag: function (tag, target) {\n if (tag === cc.Action.TAG_INVALID)\n cc.logID(1002);\n\n let hashTargets = this._hashTargets;\n if (target) {\n var element = hashTargets[target._id];\n if (element) {\n this._removeAllActionsByTag(tag, element, target);\n }\n }\n else {\n for (let name in hashTargets) {\n let element = hashTargets[name];\n this._removeAllActionsByTag(tag, element);\n }\n }\n },\n\n /**\n * !#en Gets an action given its tag an a target.\n * !#zh 通过目标对象和标签获取一个动作。\n * @method getActionByTag\n * @param {Number} tag\n * @param {Node} target\n * @return {Action|Null} return the Action with the given tag on success\n */\n getActionByTag: function (tag, target) {\n if(tag === cc.Action.TAG_INVALID)\n cc.logID(1004);\n\n var element = this._hashTargets[target._id];\n if (element) {\n if (element.actions != null) {\n for (var i = 0; i < element.actions.length; ++i) {\n var action = element.actions[i];\n if (action && action.getTag() === tag)\n return action;\n }\n }\n cc.logID(1005, tag);\n }\n return null;\n },\n\n\n /**\n * !#en\n * Returns the numbers of actions that are running in a certain target.
\n * Composable actions are counted as 1 action.
\n * Example:
\n * - If you are running 1 Sequence of 7 actions, it will return 1.
\n * - If you are running 7 Sequences of 2 actions, it will return 7.\n * !#zh\n * 返回指定对象下所有正在运行的动作数量。
\n * 组合动作被算作一个动作。
\n * 例如:
\n * - 如果您正在运行 7 个动作组成的序列动作(Sequence),这个函数将返回 1。
\n * - 如果你正在运行 2 个序列动作(Sequence)和 5 个普通动作,这个函数将返回 7。
\n *\n * @method getNumberOfRunningActionsInTarget\n * @param {Node} target\n * @return {Number}\n */\n getNumberOfRunningActionsInTarget: function (target) {\n var element = this._hashTargets[target._id];\n if (element)\n return (element.actions) ? element.actions.length : 0;\n\n return 0;\n },\n /**\n * !#en Pauses the target: all running actions and newly added actions will be paused.\n * !#zh 暂停指定对象:所有正在运行的动作和新添加的动作都将会暂停。\n * @method pauseTarget\n * @param {Node} target\n */\n pauseTarget: function (target) {\n var element = this._hashTargets[target._id];\n if (element)\n element.paused = true;\n },\n /**\n * !#en Resumes the target. All queued actions will be resumed.\n * !#zh 让指定目标恢复运行。在执行序列中所有被暂停的动作将重新恢复运行。\n * @method resumeTarget\n * @param {Node} target\n */\n resumeTarget: function (target) {\n var element = this._hashTargets[target._id];\n if (element)\n element.paused = false;\n },\n\n /**\n * !#en Pauses all running actions, returning a list of targets whose actions were paused.\n * !#zh 暂停所有正在运行的动作,返回一个包含了那些动作被暂停了的目标对象的列表。\n * @method pauseAllRunningActions\n * @return {Array} a list of targets whose actions were paused.\n */\n pauseAllRunningActions: function () {\n var idsWithActions = [];\n var locTargets = this._arrayTargets;\n for(var i = 0; i < locTargets.length; i++){\n var element = locTargets[i];\n if(element && !element.paused){\n element.paused = true;\n idsWithActions.push(element.target);\n }\n }\n return idsWithActions;\n },\n\n /**\n * !#en Resume a set of targets (convenience function to reverse a pauseAllRunningActions or pauseTargets call).\n * !#zh 让一组指定对象恢复运行(用来逆转 pauseAllRunningActions 效果的便捷函数)。\n * @method resumeTargets\n * @param {Array} targetsToResume\n */\n resumeTargets: function (targetsToResume) {\n if (!targetsToResume)\n return;\n\n for (var i = 0; i < targetsToResume.length; i++) {\n if(targetsToResume[i])\n this.resumeTarget(targetsToResume[i]);\n }\n },\n\n /**\n * !#en Pause a set of targets.\n * !#zh 暂停一组指定对象。\n * @method pauseTargets\n * @param {Array} targetsToPause\n */\n pauseTargets: function (targetsToPause) {\n if (!targetsToPause)\n return;\n\n for (var i = 0; i < targetsToPause.length; i++) {\n if (targetsToPause[i])\n this.pauseTarget(targetsToPause[i]);\n }\n },\n\n /**\n * !#en\n * purges the shared action manager. It releases the retained instance.
\n * because it uses this, so it can not be static.\n * !#zh\n * 清除共用的动作管理器。它释放了持有的实例。
\n * 因为它使用 this,因此它不能是静态的。\n * @method purgeSharedManager\n */\n purgeSharedManager: function () {\n cc.director.getScheduler().unscheduleUpdate(this);\n },\n\n //protected\n _removeActionAtIndex: function (index, element) {\n var action = element.actions[index];\n\n element.actions.splice(index, 1);\n\n // update actionIndex in case we are in tick. looping over the actions\n if (element.actionIndex >= index)\n element.actionIndex--;\n\n if (element.actions.length === 0) {\n this._deleteHashElement(element);\n }\n },\n\n _deleteHashElement: function (element) {\n var ret = false;\n if (element && !element.lock) {\n if (this._hashTargets[element.target._id]) {\n delete this._hashTargets[element.target._id];\n var targets = this._arrayTargets;\n for (var i = 0, l = targets.length; i < l; i++) {\n if (targets[i] === element) {\n targets.splice(i, 1);\n break;\n }\n }\n this._putElement(element);\n ret = true;\n }\n }\n return ret;\n },\n\n /**\n * !#en The ActionManager update。\n * !#zh ActionManager 主循环。\n * @method update\n * @param {Number} dt delta time in seconds\n */\n update: function (dt) {\n var locTargets = this._arrayTargets , locCurrTarget;\n for (var elt = 0; elt < locTargets.length; elt++) {\n this._currentTarget = locTargets[elt];\n locCurrTarget = this._currentTarget;\n if (!locCurrTarget.paused && locCurrTarget.actions) {\n locCurrTarget.lock = true;\n // The 'actions' CCMutableArray may change while inside this loop.\n for (locCurrTarget.actionIndex = 0; locCurrTarget.actionIndex < locCurrTarget.actions.length; locCurrTarget.actionIndex++) {\n locCurrTarget.currentAction = locCurrTarget.actions[locCurrTarget.actionIndex];\n if (!locCurrTarget.currentAction)\n continue;\n\n //use for speed\n locCurrTarget.currentAction.step(dt * ( locCurrTarget.currentAction._speedMethod ? locCurrTarget.currentAction._speed : 1 ) );\n \n if (locCurrTarget.currentAction && locCurrTarget.currentAction.isDone()) {\n locCurrTarget.currentAction.stop();\n var action = locCurrTarget.currentAction;\n // Make currentAction nil to prevent removeAction from salvaging it.\n locCurrTarget.currentAction = null;\n this.removeAction(action);\n }\n\n locCurrTarget.currentAction = null;\n }\n locCurrTarget.lock = false;\n }\n // only delete currentTarget if no actions were scheduled during the cycle (issue #481)\n if (locCurrTarget.actions.length === 0) {\n this._deleteHashElement(locCurrTarget) && elt--;\n }\n }\n }\n};\n\nif (CC_TEST) {\n cc.ActionManager.prototype.isTargetPaused_TEST = function (target) {\n var element = this._hashTargets[target._id];\n return element.paused;\n };\n}\n","/****************************************************************************\n Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.\n\n https://www.cocos.com/\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated engine source code (the \"Software\"), a limited,\n worldwide, royalty-free, non-assignable, revocable and non-exclusive license\n to use Cocos Creator solely to develop games on your target platforms. You shall\n not use Cocos Creator software for developing other software or tools that's\n used for developing games. You are not granted to publish, distribute,\n sublicense, and/or sell copies of Cocos Creator.\n\n The software or tools in this License Agreement are licensed, not sold.\n Xiamen Yaji Software Co., Ltd. reserves all rights not expressly granted to you.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\nrequire('./CCActionManager');\nrequire('./CCAction');\nrequire('./CCActionInterval');\nrequire('./CCActionInstant');\nrequire('./CCActionEase');\nrequire('./CCActionCatmullRom');\nrequire('./tween');\n","import { bezier } from '../animation/bezier';\n\nlet _tweenID = 0;\n\nlet TweenAction = cc.Class({\n name: 'cc.TweenAction',\n extends: cc.ActionInterval,\n\n ctor (duration, props, opts) {\n this._opts = opts = opts || Object.create(null);\n this._props = Object.create(null);\n\n // global easing or progress used for this action\n opts.progress = opts.progress || this.progress;\n if (opts.easing && typeof opts.easing === 'string') {\n let easingName = opts.easing;\n opts.easing = cc.easing[easingName];\n !opts.easing && cc.warnID(1031, easingName);\n }\n\n let relative = this._opts.relative;\n\n for (let name in props) {\n let value = props[name];\n\n // property may have custom easing or progress function\n let easing, progress;\n if (value.value !== undefined && (value.easing || value.progress)) {\n if (typeof value.easing === 'string') {\n easing = cc.easing[value.easing];\n !easing && cc.warnID(1031, value.easing);\n }\n else {\n easing = value.easing;\n }\n progress = value.progress;\n value = value.value;\n }\n\n let isNumber = typeof value === 'number';\n if (!isNumber && (!value.lerp || (relative && !value.add && !value.mul) || !value.clone)) {\n cc.warn(`Can not animate ${name} property, because it do not have [lerp, (add|mul), clone] function.`);\n continue;\n }\n\n let prop = Object.create(null);\n prop.value = value;\n prop.easing = easing;\n prop.progress = progress;\n this._props[name] = prop;\n }\n\n this._originProps = props;\n this.initWithDuration(duration);\n },\n\n clone () {\n var action = new TweenAction(this._duration, this._originProps, this._opts);\n this._cloneDecoration(action);\n return action;\n },\n\n startWithTarget (target) {\n cc.ActionInterval.prototype.startWithTarget.call(this, target);\n\n let relative = !!this._opts.relative;\n let props = this._props;\n for (let name in props) {\n let value = target[name];\n let prop = props[name];\n\n if (typeof value === 'number') {\n prop.start = value;\n prop.current = value;\n prop.end = relative ? value + prop.value : prop.value;\n }\n else {\n prop.start = value.clone();\n prop.current = value.clone();\n prop.end = relative ? (value.add || value.mul).call(value, prop.value) : prop.value;\n }\n }\n },\n\n update (t) {\n let opts = this._opts;\n let easingTime = t;\n if (opts.easing) easingTime = opts.easing(t);\n\n let target = this.target;\n if (!target) return;\n\n let props = this._props;\n let progress = opts.progress;\n for (let name in props) {\n let prop = props[name];\n let time = prop.easing ? prop.easing(t) : easingTime;\n let current = prop.current = (prop.progress || progress)(prop.start, prop.end, prop.current, time);\n target[name] = current;\n }\n\n let onUpdate = opts.onUpdate;\n if (onUpdate) {\n onUpdate(target, t)\n }\n },\n\n progress (start, end, current, t) {\n if (typeof start === 'number') {\n current = start + (end - start) * t;\n }\n else {\n start.lerp(end, t, current);\n }\n return current;\n }\n});\n\nlet SetAction = cc.Class({\n name: 'cc.SetAction',\n extends: cc.ActionInstant,\n\n ctor (props) {\n this._props = {};\n props !== undefined && this.init(props);\n },\n\n init (props) {\n for (let name in props) {\n this._props[name] = props[name];\n }\n return true;\n },\n\n update () {\n let props = this._props;\n let target = this.target;\n for (let name in props) {\n target[name] = props[name];\n }\n },\n\n clone () {\n var action = new SetAction();\n action.init(this._props);\n return action;\n }\n});\n\n\n\n/**\n * !#en\n * Tween provide a simple and flexible way to create action. Tween's api is more flexible than `cc.Action`:\n * - Support creating an action sequence in chained api.\n * - Support animate any objects' any properties, not limited to node's properties. By contrast, `cc.Action` needs to create a new action class to support new node property.\n * - Support working with `cc.Action`.\n * - Support easing and progress function.\n * !#zh\n * Tween 提供了一个简单灵活的方法来创建 action。相对于 Cocos 传统的 `cc.Action`,`cc.Tween` 在创建动画上要灵活非常多:\n * - 支持以链式结构的方式创建一个动画序列。\n * - 支持对任意对象的任意属性进行缓动,不再局限于节点上的属性,而 `cc.Action` 添加一个属性的支持时还需要添加一个新的 action 类型。\n * - 支持与 `cc.Action` 混用。\n * - 支持设置 {{#crossLink \"Easing\"}}{{/crossLink}} 或者 progress 函数。\n * @class Tween\n * @example\n * cc.tween(node)\n * .to(1, {scale: 2, position: cc.v3(100, 100, 100)})\n * .call(() => { console.log('This is a callback'); })\n * .by(1, {scale: 3, position: cc.v3(200, 200, 200)}, {easing: 'sineOutIn'})\n * .start(cc.find('Canvas/cocos'));\n * @typescript Tween
\n * 大多数情况下 动画组件 是足够和易于使用的。如果您需要更多的动画控制接口,请使用 AnimationState。\n * @class AnimationState\n * @extends Playable\n *\n */\n\n/**\n * @method constructor\n * @param {AnimationClip} clip\n * @param {String} [name]\n */\nfunction AnimationState (clip, name) {\n Playable.call(this);\n \n // Mark whether the current frame is played.\n // When set new time to animation state, we should ensure the frame at the specified time being played at next update.\n this._currentFramePlayed = false;\n \n this._delay = 0;\n this._delayTime = 0;\n\n this._wrappedInfo = new WrappedInfo();\n this._lastWrappedInfo = null;\n\n this._process = process;\n\n this._clip = clip;\n this._name = name || (clip && clip.name);\n\n /**\n * @property animator\n * @type {AnimationAnimator}\n * @private\n */\n this.animator = null;\n\n /**\n * !#en The curves list.\n * !#zh 曲线列表。\n * @property curves\n * @type {Object[]}\n */\n this.curves = [];\n\n // http://www.w3.org/TR/web-animations/#idl-def-AnimationTiming\n\n /**\n * !#en The start delay which represents the number of seconds from an animation's start time to the start of\n * the active interval.\n * !#zh 延迟多少秒播放。\n *\n * @property delay\n * @type {Number}\n * @default 0\n */\n this.delay = 0;\n\n /**\n * !#en The animation's iteration count property.\n *\n * A real number greater than or equal to zero (including positive infinity) representing the number of times\n * to repeat the animation node.\n *\n * Values less than zero and NaN values are treated as the value 1.0 for the purpose of timing model\n * calculations.\n *\n * !#zh 迭代次数,指动画播放多少次后结束, normalize time。 如 2.5(2次半)\n *\n * @property repeatCount\n * @type {Number}\n * @default 1\n */\n this.repeatCount = 1;\n\n /**\n * !#en The iteration duration of this animation in seconds. (length)\n * !#zh 单次动画的持续时间,秒。\n *\n * @property duration\n * @type {Number}\n * @readOnly\n */\n this.duration = 1;\n\n /**\n * !#en The animation's playback speed. 1 is normal playback speed.\n * !#zh 播放速率。\n * @property speed\n * @type {Number}\n * @default: 1.0\n */\n this.speed = 1;\n\n /**\n * !#en\n * Wrapping mode of the playing animation.\n * Notice : dynamic change wrapMode will reset time and repeatCount property\n * !#zh\n * 动画循环方式。\n * 需要注意的是,动态修改 wrapMode 时,会重置 time 以及 repeatCount\n *\n * @property wrapMode\n * @type {WrapMode}\n * @default: WrapMode.Normal\n */\n this.wrapMode = WrapMode.Normal;\n\n /**\n * !#en The current time of this animation in seconds.\n * !#zh 动画当前的时间,秒。\n * @property time\n * @type {Number}\n * @default 0\n */\n this.time = 0;\n\n // Animation as event target\n this._target = null;\n this._lastframeEventOn = false;\n this.emit = function () {\n var args = new Array(arguments.length);\n for (var i = 0, l = args.length; i < l; i++) {\n args[i] = arguments[i];\n }\n cc.director.getAnimationManager().pushDelayEvent(this, '_emit', args);\n };\n}\njs.extend(AnimationState, Playable);\n\nvar proto = AnimationState.prototype;\n\nproto._emit = function (type, state) {\n if (this._target && this._target.isValid) {\n this._target.emit(type, type, state);\n }\n};\n\nproto.on = function (type, callback, target) {\n if (this._target && this._target.isValid) {\n if (type === 'lastframe') {\n this._lastframeEventOn = true;\n }\n return this._target.on(type, callback, target);\n }\n else {\n return null;\n }\n};\n\nproto.once = function (type, callback, target) {\n if (this._target && this._target.isValid) {\n if (type === 'lastframe') {\n this._lastframeEventOn = true;\n }\n let self = this;\n return this._target.once(type, function (event) {\n callback.call(target, event);\n self._lastframeEventOn = false;\n });\n }\n else {\n return null;\n }\n};\n\nproto.off = function (type, callback, target) {\n if (this._target && this._target.isValid) {\n if (type === 'lastframe') {\n if (!this._target.hasEventListener(type)) {\n this._lastframeEventOn = false;\n }\n }\n this._target.off(type, callback, target);\n }\n};\n\nproto._setEventTarget = function (target) {\n this._target = target;\n};\n\nproto.onPlay = function () {\n // replay\n this.setTime(0);\n this._delayTime = this._delay;\n \n cc.director.getAnimationManager().addAnimation(this);\n\n if (this.animator) {\n this.animator.addAnimation(this);\n }\n \n this.emit('play', this);\n};\n\nproto.onStop = function () {\n if (!this.isPaused) {\n cc.director.getAnimationManager().removeAnimation(this);\n }\n\n if (this.animator) {\n this.animator.removeAnimation(this);\n }\n\n this.emit('stop', this);\n};\n\nproto.onResume = function () {\n cc.director.getAnimationManager().addAnimation(this);\n this.emit('resume', this);\n};\n\nproto.onPause = function () {\n cc.director.getAnimationManager().removeAnimation(this);\n this.emit('pause', this);\n};\n\nproto.setTime = function (time) {\n this._currentFramePlayed = false;\n this.time = time || 0;\n\n var curves = this.curves;\n for (var i = 0, l = curves.length; i < l; i++) {\n var curve = curves[i];\n if (curve.onTimeChangedManually) {\n curve.onTimeChangedManually(time, this);\n }\n }\n};\n\nfunction process () {\n // sample\n var info = this.sample();\n\n if (this._lastframeEventOn) {\n var lastInfo;\n if (!this._lastWrappedInfo) {\n lastInfo = this._lastWrappedInfo = new WrappedInfo(info);\n } else {\n lastInfo = this._lastWrappedInfo;\n }\n\n if (this.repeatCount > 1 && ((info.iterations | 0) > (lastInfo.iterations | 0))) {\n this.emit('lastframe', this);\n }\n\n lastInfo.set(info);\n }\n\n if (info.stopped) {\n this.stop();\n this.emit('finished', this);\n }\n}\n\nfunction simpleProcess () {\n var time = this.time;\n var duration = this.duration;\n\n if (time > duration) {\n time = time % duration;\n if (time === 0) time = duration;\n }\n else if (time < 0) {\n time = time % duration;\n if (time !== 0) time += duration;\n }\n\n var ratio = time / duration;\n\n var curves = this.curves;\n for (var i = 0, len = curves.length; i < len; i++) {\n var curve = curves[i];\n curve.sample(time, ratio, this);\n }\n\n if (this._lastframeEventOn) {\n if (this._lastIterations === undefined) {\n this._lastIterations = ratio;\n }\n\n if ((this.time > 0 && this._lastIterations > ratio) || (this.time < 0 && this._lastIterations < ratio)) {\n this.emit('lastframe', this);\n }\n\n this._lastIterations = ratio;\n }\n}\n\nproto.update = function (delta) {\n // calculate delay time\n\n if (this._delayTime > 0) {\n this._delayTime -= delta;\n if (this._delayTime > 0) {\n // still waiting\n return;\n }\n }\n\n // make first frame perfect\n\n //var playPerfectFirstFrame = (this.time === 0);\n if (this._currentFramePlayed) {\n this.time += (delta * this.speed);\n }\n else {\n this._currentFramePlayed = true;\n }\n\n this._process();\n};\n\nproto._needRevers = function (currentIterations) {\n var wrapMode = this.wrapMode;\n var needRevers = false;\n\n if ((wrapMode & WrapModeMask.PingPong) === WrapModeMask.PingPong) {\n var isEnd = currentIterations - (currentIterations | 0) === 0;\n if (isEnd && (currentIterations > 0)) {\n currentIterations -= 1;\n }\n\n var isOddIteration = currentIterations & 1;\n if (isOddIteration) {\n needRevers = !needRevers;\n }\n }\n if ((wrapMode & WrapModeMask.Reverse) === WrapModeMask.Reverse) {\n needRevers = !needRevers;\n }\n return needRevers;\n};\n\nproto.getWrappedInfo = function (time, info) {\n info = info || new WrappedInfo();\n \n var stopped = false;\n var duration = this.duration;\n var repeatCount = this.repeatCount;\n\n var currentIterations = time > 0 ? (time / duration) : -(time / duration);\n if (currentIterations >= repeatCount) {\n currentIterations = repeatCount;\n\n stopped = true;\n var tempRatio = repeatCount - (repeatCount | 0);\n if (tempRatio === 0) {\n tempRatio = 1; // 如果播放过,动画不复位\n }\n time = tempRatio * duration * (time > 0 ? 1 : -1);\n }\n\n if (time > duration) {\n var tempTime = time % duration;\n time = tempTime === 0 ? duration : tempTime;\n }\n else if (time < 0) {\n time = time % duration;\n if (time !== 0 ) time += duration;\n }\n\n var needRevers = false;\n var shouldWrap = this._wrapMode & WrapModeMask.ShouldWrap;\n if (shouldWrap) {\n needRevers = this._needRevers(currentIterations);\n }\n\n var direction = needRevers ? -1 : 1;\n if (this.speed < 0) {\n direction *= -1;\n }\n\n // calculate wrapped time\n if (shouldWrap && needRevers) {\n time = duration - time;\n }\n\n info.ratio = time / duration;\n info.time = time;\n info.direction = direction;\n info.stopped = stopped;\n info.iterations = currentIterations;\n\n return info;\n};\n\nproto.sample = function () {\n var info = this.getWrappedInfo(this.time, this._wrappedInfo);\n var curves = this.curves;\n for (var i = 0, len = curves.length; i < len; i++) {\n var curve = curves[i];\n curve.sample(info.time, info.ratio, this);\n }\n\n return info;\n};\n\n\n/**\n * !#en The clip that is being played by this animation state.\n * !#zh 此动画状态正在播放的剪辑。\n * @property clip\n * @type {AnimationClip}\n * @final\n */\njs.get(proto, 'clip', function () {\n return this._clip;\n});\n\n/**\n * !#en The name of the playing animation.\n * !#zh 动画的名字\n * @property name\n * @type {String}\n * @readOnly\n */\njs.get(proto, 'name', function () {\n return this._name;\n});\n\njs.obsolete(proto, 'AnimationState.length', 'duration');\n\njs.getset(proto, 'curveLoaded',\n function () {\n return this.curves.length > 0;\n },\n function () {\n this.curves.length = 0;\n }\n);\n\n\njs.getset(proto, 'wrapMode',\n function () {\n return this._wrapMode;\n },\n function (value) {\n this._wrapMode = value;\n\n if (CC_EDITOR) return;\n\n // dynamic change wrapMode will need reset time to 0\n this.time = 0;\n\n if (value & WrapModeMask.Loop) {\n this.repeatCount = Infinity;\n }\n else {\n this.repeatCount = 1;\n }\n \n }\n);\n\njs.getset(proto, 'repeatCount',\n function () {\n return this._repeatCount;\n },\n function (value) {\n this._repeatCount = value;\n \n var shouldWrap = this._wrapMode & WrapModeMask.ShouldWrap;\n var reverse = (this.wrapMode & WrapModeMask.Reverse) === WrapModeMask.Reverse;\n if (value === Infinity && !shouldWrap && !reverse) {\n this._process = simpleProcess;\n }\n else {\n this._process = process;\n }\n }\n);\n\njs.getset(proto, 'delay', \n function () {\n return this._delay;\n },\n function (value) {\n this._delayTime = this._delay = value;\n }\n);\n\n\ncc.AnimationState = module.exports = AnimationState;\n","/****************************************************************************\n Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.\n\n https://www.cocos.com/\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated engine source code (the \"Software\"), a limited,\n worldwide, royalty-free, non-assignable, revocable and non-exclusive license\n to use Cocos Creator solely to develop games on your target platforms. You shall\n not use Cocos Creator software for developing other software or tools that's\n used for developing games. You are not granted to publish, distribute,\n sublicense, and/or sell copies of Cocos Creator.\n\n The software or tools in this License Agreement are licensed, not sold.\n Xiamen Yaji Software Co., Ltd. reserves all rights not expressly granted to you.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n//var bezier = (function () {\n// function B1 (t) { return (t * t * t); }\n// function B2 (t) { return (3 * t * t * (1 - t)); }\n// function B3 (t) { return (3 * t * (1 - t) * (1 - t)); }\n// function B4 (t) { return ((1 - t) * (1 - t) * (1 - t)); }\n// function bezier (C1, C2, C3, C4, t) {\n// return C1 * B1(t) + C2 * B2(t) + C3 * B3(t) + C4 * B4(t);\n// }\n//\n// //function bezier (C1, C2, C3, C4, t, out) {\n// // out.x = C1.x * B1(t) + C2.x * B2(t) + C3.x * B3(t) + C4.x * B4(t);\n// // out.y = C1.y * B1(t) + C2.y * B2(t) + C3.y * B3(t) + C4.y * B4(t);\n// //}\n//\n// return bezier;\n//})();\nfunction bezier (C1, C2, C3, C4, t) {\n var t1 = 1 - t;\n return t1 * (t1 * (C1 + (C2 * 3 - C1) * t) + C3 * 3 * t * t) + C4 * t * t * t;\n}\n//function bezier (c0, c1, c2, c3, t) {\n// var cy = 3.0 * (c1);\n// var by = 3.0 * (c3 - c1) - cy;\n// var ay = 1 - cy - by;\n// return (ay * t * t * t) + (by * t * t) + (cy * t);\n//}\n\n//var sin = Math.sin;\nvar cos = Math.cos,\n acos = Math.acos,\n max = Math.max,\n //atan2 = Math.atan2,\n pi = Math.PI,\n tau = 2 * pi,\n sqrt = Math.sqrt;\n\nfunction crt (v) {\n if (v < 0) {\n return -Math.pow(-v, 1 / 3);\n }\n else {\n return Math.pow(v, 1 / 3);\n }\n}\n\n//function align (curve, line) {\n// var tx = line.p1.x,\n// ty = line.p1.y,\n// a = -atan2(line.p2.y-ty, line.p2.x-tx);\n// curve = [{x:0, y:1}, {x: curve[0], y: 1-curve[1]}, {x: curve[2], y: 1-curve[3]}, {x:1, y:0}];\n// return curve.map(function(v) {\n// return {\n// x: (v.x-tx)*cos(a) - (v.y-ty)*sin(a),\n// y: (v.x-tx)*sin(a) + (v.y-ty)*cos(a)\n// };\n// });\n//}\n\n// Modified from http://jsbin.com/yibipofeqi/1/edit, optimized for animations.\n// The origin Cardano's algorithm is based on http://www.trans4mind.com/personal_development/mathematics/polynomials/cubicAlgebra.htm\nfunction cardano (curve, x) {\n // align curve with the intersecting line:\n //var line = {p1: {x: x, y: 0}, p2: {x: x, y: 1}};\n //var aligned = align(curve, line);\n //// and rewrite from [a(1-t)^3 + 3bt(1-t)^2 + 3c(1-t)t^2 + dt^3] form\n // pa = aligned[0].y,\n // pb = aligned[1].y,\n // pc = aligned[2].y,\n // pd = aligned[3].y;\n ////// curve = [{x:0, y:1}, {x: curve[0], y: 1-curve[1]}, {x: curve[2], y: 1-curve[3]}, {x:1, y:0}];\n var pa = x - 0;\n var pb = x - curve[0];\n var pc = x - curve[2];\n var pd = x - 1;\n\n // to [t^3 + at^2 + bt + c] form:\n var pa3 = pa * 3;\n var pb3 = pb * 3;\n var pc3 = pc * 3;\n var d = (-pa + pb3 - pc3 + pd),\n rd = 1 / d,\n r3 = 1 / 3,\n a = (pa3 - 6 * pb + pc3) * rd,\n a3 = a * r3,\n b = (-pa3 + pb3) * rd,\n c = pa * rd,\n // then, determine p and q:\n p = (3 * b - a * a) * r3,\n p3 = p * r3,\n q = (2 * a * a * a - 9 * a * b + 27 * c) / 27,\n q2 = q / 2,\n // and determine the discriminant:\n discriminant = q2 * q2 + p3 * p3 * p3,\n // and some reserved variables\n u1, v1, x1, x2, x3;\n\n // If the discriminant is negative, use polar coordinates\n // to get around square roots of negative numbers\n if (discriminant < 0) {\n var mp3 = -p * r3,\n mp33 = mp3 * mp3 * mp3,\n r = sqrt(mp33),\n // compute cosphi corrected for IEEE float rounding:\n t = -q / (2 * r),\n cosphi = t < -1 ? -1 : t > 1 ? 1 : t,\n phi = acos(cosphi),\n crtr = crt(r),\n t1 = 2 * crtr;\n x1 = t1 * cos(phi * r3) - a3;\n x2 = t1 * cos((phi + tau) * r3) - a3;\n x3 = t1 * cos((phi + 2 * tau) * r3) - a3;\n\n // choose best percentage\n if (0 <= x1 && x1 <= 1) {\n if (0 <= x2 && x2 <= 1) {\n if (0 <= x3 && x3 <= 1) {\n return max(x1, x2, x3);\n }\n else {\n return max(x1, x2);\n }\n }\n else if (0 <= x3 && x3 <= 1) {\n return max(x1, x3);\n }\n else {\n return x1;\n }\n }\n else {\n if (0 <= x2 && x2 <= 1) {\n if (0 <= x3 && x3 <= 1) {\n return max(x2, x3);\n }\n else {\n return x2;\n }\n }\n else {\n return x3;\n }\n }\n }\n else if (discriminant === 0) {\n u1 = q2 < 0 ? crt(-q2) : -crt(q2);\n x1 = 2 * u1 - a3;\n x2 = -u1 - a3;\n\n // choose best percentage\n if (0 <= x1 && x1 <= 1) {\n if (0 <= x2 && x2 <= 1) {\n return max(x1, x2);\n }\n else {\n return x1;\n }\n }\n else {\n return x2;\n }\n }\n // one real root, and two imaginary roots\n else {\n var sd = sqrt(discriminant);\n u1 = crt(-q2 + sd);\n v1 = crt(q2 + sd);\n x1 = u1 - v1 - a3;\n return x1;\n }\n}\n\nfunction bezierByTime (controlPoints, x) {\n var percent = cardano(controlPoints, x); // t\n var p1y = controlPoints[1]; // b\n var p2y = controlPoints[3]; // c\n // return bezier(0, p1y, p2y, 1, percent);\n return ((1 - percent) * (p1y + (p2y - p1y) * percent) * 3 + percent * percent) * percent;\n}\n\nif (CC_TEST) {\n cc._Test.bezier = bezier;\n cc._Test.bezierByTime = bezierByTime;\n}\n\nmodule.exports = {\n bezier: bezier,\n bezierByTime: bezierByTime\n};\n","/****************************************************************************\n Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.\n\n https://www.cocos.com/\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated engine source code (the \"Software\"), a limited,\n worldwide, royalty-free, non-assignable, revocable and non-exclusive license\n to use Cocos Creator solely to develop games on your target platforms. You shall\n not use Cocos Creator software for developing other software or tools that's\n used for developing games. You are not granted to publish, distribute,\n sublicense, and/or sell copies of Cocos Creator.\n\n The software or tools in this License Agreement are licensed, not sold.\n Xiamen Yaji Software Co., Ltd. reserves all rights not expressly granted to you.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n/**\n * @module cc\n */\n\n /**\n * !#en\n * This class provide easing methods for {{#crossLink \"tween\"}}{{/crossLink}} class.
\n * Demonstratio: https://easings.net/\n * !#zh\n * 缓动函数类,为 {{#crossLink \"Tween\"}}{{/crossLink}} 提供缓动效果函数。
\n * 函数效果演示: https://easings.net/\n * @class Easing\n */\n\nvar easing = {\n constant: function () { return 0; },\n linear: function (k) { return k; },\n\n // quad\n // easing equation function for a quadratic (t^2)\n // @param t: Current time (in frames or seconds).\n // @return: The correct value.\n\n /**\n * !#en Easing in with quadratic formula. From slow to fast.\n * !#zh 平方曲线缓入函数。运动由慢到快。\n * @method quadIn\n * @param {Number} t The current time as a percentage of the total time.\n * @return {Number} The correct value\n */\n quadIn: function (k) { return k * k; },\n /**\n * !#en Easing out with quadratic formula. From fast to slow.\n * !#zh 平方曲线缓出函数。运动由快到慢。\n * @method quadOut\n * @param {Number} t The current time as a percentage of the total time.\n * @return {Number} The correct value\n */\n quadOut: function (k) { return k * ( 2 - k ); },\n /**\n * !#en Easing in and out with quadratic formula. From slow to fast, then back to slow.\n * !#zh 平方曲线缓入缓出函数。运动由慢到快再到慢。\n * @method quadInOut\n * @param {Number} t The current time as a percentage of the total time.\n * @return {Number} The correct value\n */\n quadInOut: function (k) {\n if (( k *= 2 ) < 1) {\n return 0.5 * k * k;\n }\n return -0.5 * ( --k * ( k - 2 ) - 1 );\n },\n\n // cubic\n // easing equation function for a cubic (t^3)\n // @param t: Current time (in frames or seconds).\n // @return: The correct value.\n\n /**\n * !#en Easing in with cubic formula. From slow to fast.\n * !#zh 立方曲线缓入函数。运动由慢到快。\n * @method cubicIn\n * @param {Number} t The current time as a percentage of the total time.\n * @return {Number} The correct value.\n */\n cubicIn: function (k) { return k * k * k; },\n /**\n * !#en Easing out with cubic formula. From slow to fast.\n * !#zh 立方曲线缓出函数。运动由快到慢。\n * @method cubicOut\n * @param {Number} t The current time as a percentage of the total time.\n * @return {Number} The correct value.\n */\n cubicOut: function (k) { return --k * k * k + 1; },\n /**\n * !#en Easing in and out with cubic formula. From slow to fast, then back to slow.\n * !#zh 立方曲线缓入缓出函数。运动由慢到快再到慢。\n * @method cubicInOut\n * @param {Number} t The current time as a percentage of the total time.\n * @return {Number} The correct value.\n */\n cubicInOut: function (k) {\n if (( k *= 2 ) < 1) {\n return 0.5 * k * k * k;\n }\n return 0.5 * ( ( k -= 2 ) * k * k + 2 );\n },\n\n // quart\n // easing equation function for a quartic (t^4)\n // @param t: Current time (in frames or seconds).\n // @return: The correct value.\n\n /**\n * !#en Easing in with quartic formula. From slow to fast.\n * !#zh 四次方曲线缓入函数。运动由慢到快。\n * @method quartIn\n * @param {Number} t The current time as a percentage of the total time.\n * @return {Number} The correct value.\n */\n quartIn: function (k) { return k * k * k * k; },\n /**\n * !#en Easing out with quartic formula. From fast to slow.\n * !#zh 四次方曲线缓出函数。运动由快到慢。\n * @method quartOut\n * @param {Number} t The current time as a percentage of the total time.\n * @return {Number} The correct value.\n */\n quartOut: function (k) { return 1 - ( --k * k * k * k ); },\n /**\n * !#en Easing in and out with quartic formula. From slow to fast, then back to slow.\n * !#zh 四次方曲线缓入缓出函数。运动由慢到快再到慢。\n * @method quartInOut\n * @param {Number} t The current time as a percentage of the total time.\n * @return {Number} The correct value.\n */\n quartInOut: function (k) {\n if (( k *= 2 ) < 1) {\n return 0.5 * k * k * k * k;\n }\n return -0.5 * ( ( k -= 2 ) * k * k * k - 2 );\n },\n\n // quint\n // easing equation function for a quintic (t^5)\n // @param t: Current time (in frames or seconds).\n // @return: The correct value.\n\n /**\n * !#en Easing in with quintic formula. From slow to fast.\n * !#zh 五次方曲线缓入函数。运动由慢到快。\n * @method quintIn\n * @param {Number} t The current time as a percentage of the total time.\n * @return {Number} The correct value.\n */\n quintIn: function (k) { return k * k * k * k * k; },\n /**\n * !#en Easing out with quintic formula. From fast to slow.\n * !#zh 五次方曲线缓出函数。运动由快到慢。\n * @method quintOut\n * @param {Number} t The current time as a percentage of the total time.\n * @return {Number} The correct value.\n */\n quintOut: function (k) { return --k * k * k * k * k + 1; },\n /**\n * !#en Easing in and out with quintic formula. From slow to fast, then back to slow.\n * !#zh 五次方曲线缓入缓出函数。运动由慢到快再到慢。\n * @method quintInOut\n * @param {Number} t The current time as a percentage of the total time.\n * @return {Number} The correct value.\n */\n quintInOut: function (k) {\n if (( k *= 2 ) < 1) {\n return 0.5 * k * k * k * k * k;\n }\n return 0.5 * ( ( k -= 2 ) * k * k * k * k + 2 );\n },\n\n // sine\n // easing equation function for a sinusoidal (sin(t))\n // @param t: Current time (in frames or seconds).\n // @return: The correct value.\n\n /**\n * !#en Easing in and out with sine formula. From slow to fast.\n * !#zh 正弦曲线缓入函数。运动由慢到快。\n * @method sineIn\n * @param {Number} t The current time as a percentage of the total time.\n * @return {Number} The correct value.\n */\n sineIn: function (k) { return 1 - Math.cos(k * Math.PI / 2); },\n /**\n * !#en Easing in and out with sine formula. From fast to slow.\n * !#zh 正弦曲线缓出函数。运动由快到慢。\n * @method sineOut\n * @param {Number} t The current time as a percentage of the total time.\n * @return {Number} The correct value.\n */\n sineOut: function (k) { return Math.sin(k * Math.PI / 2); },\n /**\n * !#en Easing in and out with sine formula. From slow to fast, then back to slow.\n * !#zh 正弦曲线缓入缓出函数。运动由慢到快再到慢。\n * @method sineInOut\n * @param {Number} t The current time as a percentage of the total time.\n * @return {Number} The correct value.\n */\n sineInOut: function (k) { return 0.5 * ( 1 - Math.cos(Math.PI * k) ); },\n\n // expo\n // easing equation function for an exponential (2^t)\n // param t: Current time (in frames or seconds).\n // return: The correct value.\n\n /**\n * !#en Easing in and out with exponential formula. From slow to fast.\n * !#zh 指数曲线缓入函数。运动由慢到快。\n * @method expoIn\n * @param {Number} t The current time as a percentage of the total time.\n * @return {Number} The correct value.\n */\n expoIn: function (k) { return k === 0 ? 0 : Math.pow(1024, k - 1); },\n /**\n * !#en Easing in and out with exponential formula. From fast to slow.\n * !#zh 指数曲线缓出函数。运动由快到慢。\n * @method expoOut\n * @param {Number} t The current time as a percentage of the total time.\n * @return {Number} The correct value.\n */\n expoOut: function (k) { return k === 1 ? 1 : 1 - Math.pow(2, -10 * k); },\n /**\n * !#en Easing in and out with exponential formula. From slow to fast.\n * !#zh 指数曲线缓入和缓出函数。运动由慢到很快再到慢。\n * @method expoInOut\n * @param {Number} t The current time as a percentage of the total time, then back to slow.\n * @return {Number} The correct value.\n */\n expoInOut: function (k) {\n if (k === 0) {\n return 0;\n }\n if (k === 1) {\n return 1;\n }\n if (( k *= 2 ) < 1) {\n return 0.5 * Math.pow(1024, k - 1);\n }\n return 0.5 * ( -Math.pow(2, -10 * ( k - 1 )) + 2 );\n },\n\n // circ\n // easing equation function for a circular (sqrt(1-t^2))\n // @param t: Current time (in frames or seconds).\n // @return:\tThe correct value.\n\n /**\n * !#en Easing in and out with circular formula. From slow to fast.\n * !#zh 循环公式缓入函数。运动由慢到快。\n * @method circIn\n * @param {Number} t The current time as a percentage of the total time.\n * @return {Number} The correct value.\n */\n circIn: function (k) { return 1 - Math.sqrt(1 - k * k); },\n /**\n * !#en Easing in and out with circular formula. From fast to slow.\n * !#zh 循环公式缓出函数。运动由快到慢。\n * @method circOut\n * @param {Number} t The current time as a percentage of the total time.\n * @return {Number} The correct value.\n */\n circOut: function (k) { return Math.sqrt(1 - ( --k * k )); },\n /**\n * !#en Easing in and out with circular formula. From slow to fast.\n * !#zh 指数曲线缓入缓出函数。运动由慢到很快再到慢。\n * @method circInOut\n * @param {Number} t The current time as a percentage of the total time, then back to slow.\n * @return {Number} The correct value.\n */\n circInOut: function (k) {\n if (( k *= 2 ) < 1) {\n return -0.5 * ( Math.sqrt(1 - k * k) - 1);\n }\n return 0.5 * ( Math.sqrt(1 - ( k -= 2) * k) + 1);\n },\n\n // elastic\n // easing equation function for an elastic (exponentially decaying sine wave)\n // @param t: Current time (in frames or seconds).\n // @return: The correct value.\n // recommand value: elastic (t)\n\n /**\n * !#en Easing in action with a spring oscillating effect.\n * !#zh 弹簧回震效果的缓入函数。\n * @method elasticIn\n * @param {Number} t The current time as a percentage of the total time.\n * @return {Number} The correct value.\n */\n elasticIn: function (k) {\n var s, a = 0.1, p = 0.4;\n if (k === 0) {\n return 0;\n }\n if (k === 1) {\n return 1;\n }\n if (!a || a < 1) {\n a = 1;\n s = p / 4;\n }\n else {\n s = p * Math.asin(1 / a) / ( 2 * Math.PI );\n }\n return -( a * Math.pow(2, 10 * ( k -= 1 )) * Math.sin(( k - s ) * ( 2 * Math.PI ) / p) );\n },\n /**\n * !#en Easing out action with a spring oscillating effect.\n * !#zh 弹簧回震效果的缓出函数。\n * @method elasticOut\n * @param {Number} t The current time as a percentage of the total time.\n * @return {Number} The correct value.\n */\n elasticOut: function (k) {\n var s, a = 0.1, p = 0.4;\n if (k === 0) {\n return 0;\n }\n if (k === 1) {\n return 1;\n }\n if (!a || a < 1) {\n a = 1;\n s = p / 4;\n }\n else {\n s = p * Math.asin(1 / a) / ( 2 * Math.PI );\n }\n return ( a * Math.pow(2, -10 * k) * Math.sin(( k - s ) * ( 2 * Math.PI ) / p) + 1 );\n },\n /**\n * !#en Easing in and out action with a spring oscillating effect.\n * !#zh 弹簧回震效果的缓入缓出函数。\n * @method elasticInOut\n * @param {Number} t The current time as a percentage of the total time.\n * @return {Number} The correct value.\n */\n elasticInOut: function (k) {\n var s, a = 0.1, p = 0.4;\n if (k === 0) {\n return 0;\n }\n if (k === 1) {\n return 1;\n }\n if (!a || a < 1) {\n a = 1;\n s = p / 4;\n }\n else {\n s = p * Math.asin(1 / a) / ( 2 * Math.PI );\n }\n if (( k *= 2 ) < 1) {\n return -0.5 *\n ( a * Math.pow(2, 10 * ( k -= 1 )) * Math.sin(( k - s ) * ( 2 * Math.PI ) / p) );\n }\n return a * Math.pow(2, -10 * ( k -= 1 )) * Math.sin(( k - s ) * ( 2 * Math.PI ) / p) * 0.5 + 1;\n },\n\n // back\n // easing equation function for a back (overshooting cubic easing: (s+1)*t^3 - s*t^2)\n // @param t: Current time (in frames or seconds).\n // @return: The correct value.\n\n /**\n * !#en Easing in action with \"back up\" behavior.\n * !#zh 回退效果的缓入函数。\n * @method backIn\n * @param {Number} t The current time as a percentage of the total time.\n * @return {Number} The correct value.\n */\n backIn: function (k) {\n var s = 1.70158;\n return k * k * ( ( s + 1 ) * k - s );\n },\n /**\n * !#en Easing out action with \"back up\" behavior.\n * !#zh 回退效果的缓出函数。\n * @method backOut\n * @param {Number} t The current time as a percentage of the total time.\n * @return {Number} The correct value.\n */\n backOut: function (k) {\n var s = 1.70158;\n return --k * k * ( ( s + 1 ) * k + s ) + 1;\n },\n /**\n * !#en Easing in and out action with \"back up\" behavior.\n * !#zh 回退效果的缓入缓出函数。\n * @method backInOut\n * @param {Number} t The current time as a percentage of the total time.\n * @return {Number} The correct value.\n */\n backInOut: function (k) {\n var s = 1.70158 * 1.525;\n if (( k *= 2 ) < 1) {\n return 0.5 * ( k * k * ( ( s + 1 ) * k - s ) );\n }\n return 0.5 * ( ( k -= 2 ) * k * ( ( s + 1 ) * k + s ) + 2 );\n },\n\n // bounce\n // easing equation function for a bounce (exponentially decaying parabolic bounce)\n // @param t: Current time (in frames or seconds).\n // @return: The correct value.\n\n /**\n * !#en Easing in action with bouncing effect.\n * !#zh 弹跳效果的缓入函数。\n * @method bounceIn\n * @param {Number} t The current time as a percentage of the total time.\n * @return {Number} The correct value.\n */\n bounceIn: function (k) {\n return 1 - easing.bounceOut(1 - k);\n },\n /**\n * !#en Easing out action with bouncing effect.\n * !#zh 弹跳效果的缓出函数。\n * @method bounceOut\n * @param {Number} t The current time as a percentage of the total time.\n * @return {Number} The correct value.\n */\n bounceOut: function (k) {\n if (k < ( 1 / 2.75 )) {\n return 7.5625 * k * k;\n }\n else if (k < ( 2 / 2.75 )) {\n return 7.5625 * ( k -= ( 1.5 / 2.75 ) ) * k + 0.75;\n }\n else if (k < ( 2.5 / 2.75 )) {\n return 7.5625 * ( k -= ( 2.25 / 2.75 ) ) * k + 0.9375;\n }\n else {\n return 7.5625 * ( k -= ( 2.625 / 2.75 ) ) * k + 0.984375;\n }\n },\n /**\n * !#en Easing in and out action with bouncing effect.\n * !#zh 弹跳效果的缓入缓出函数。\n * @method bounceInOut\n * @param {Number} t The current time as a percentage of the total time.\n * @return {Number} The correct value.\n */\n bounceInOut: function (k) {\n if (k < 0.5) {\n return easing.bounceIn(k * 2) * 0.5;\n }\n return easing.bounceOut(k * 2 - 1) * 0.5 + 0.5;\n },\n\n /**\n * !#en Target will run action with smooth effect.\n * !#zh 平滑效果函数。\n * @method smooth\n * @param {Number} t The current time as a percentage of the total time.\n * @return {Number} The correct value.\n */\n // t<=0: 0 | 0
\n * - In Cocos Creator, error is red.
\n * - In Chrome, error have a red icon along with red message text.
\n * !#zh\n * 输出错误消息到 Cocos Creator 编辑器的 Console 或运行时页面端的 Console 中。
\n * - 在 Cocos Creator 中,错误信息显示是红色的。
\n * - 在 Chrome 中,错误信息有红色的图标以及红色的消息文本。
\n *\n * @method error\n * @param {any} msg - A JavaScript string containing zero or more substitution strings.\n * @param {any} ...subst - JavaScript objects with which to replace substitution strings within msg. This gives you additional control over the format of the output.\n */\n if (CC_EDITOR) {\n cc.error = Editor.error;\n }\n else if (console.error.bind) {\n // use bind to avoid pollute call stacks\n cc.error = console.error.bind(console);\n }\n else {\n cc.error = CC_JSB || CC_RUNTIME ? console.error : function () {\n return console.error.apply(console, arguments);\n };\n }\n cc.assert = function (cond, msg) {\n if (!cond) {\n if (msg) {\n msg = cc.js.formatStr.apply(null, cc.js.shiftArguments.apply(null, arguments));\n }\n if (CC_DEV) {\n debugger;\n }\n if (CC_TEST) {\n ok(false, msg);\n }\n else {\n throw new Error(msg);\n }\n }\n }\n }\n if (mode !== DebugMode.ERROR) {\n /**\n * !#en\n * Outputs a warning message to the Cocos Creator Console (editor) or Web Console (runtime).\n * - In Cocos Creator, warning is yellow.\n * - In Chrome, warning have a yellow warning icon with the message text.\n * !#zh\n * 输出警告消息到 Cocos Creator 编辑器的 Console 或运行时 Web 端的 Console 中。
\n * - 在 Cocos Creator 中,警告信息显示是黄色的。
\n * - 在 Chrome 中,警告信息有着黄色的图标以及黄色的消息文本。
\n * @method warn\n * @param {any} msg - A JavaScript string containing zero or more substitution strings.\n * @param {any} ...subst - JavaScript objects with which to replace substitution strings within msg. This gives you additional control over the format of the output.\n */\n if (CC_EDITOR) {\n cc.warn = Editor.warn;\n }\n else if (console.warn.bind) {\n // use bind to avoid pollute call stacks\n cc.warn = console.warn.bind(console);\n }\n else {\n cc.warn = CC_JSB || CC_RUNTIME ? console.warn : function () {\n return console.warn.apply(console, arguments);\n };\n }\n }\n if (CC_EDITOR) {\n cc.log = Editor.log;\n }\n else if (mode === DebugMode.INFO) {\n /**\n * !#en Outputs a message to the Cocos Creator Console (editor) or Web Console (runtime).\n * !#zh 输出一条消息到 Cocos Creator 编辑器的 Console 或运行时 Web 端的 Console 中。\n * @method log\n * @param {String|any} msg - A JavaScript string containing zero or more substitution strings.\n * @param {any} ...subst - JavaScript objects with which to replace substitution strings within msg. This gives you additional control over the format of the output.\n */\n if (CC_JSB || CC_RUNTIME) {\n if (scriptEngineType === \"JavaScriptCore\") {\n // console.log has to use `console` as its context for iOS 8~9. Therefore, apply it.\n cc.log = function () {\n return console.log.apply(console, arguments);\n };\n } else {\n cc.log = console.log;\n }\n }\n else if (console.log.bind) {\n // use bind to avoid pollute call stacks\n cc.log = console.log.bind(console);\n }\n else {\n cc.log = function () {\n return console.log.apply(console, arguments);\n };\n }\n }\n};\n\ncc._throw = CC_EDITOR ? Editor.error : function (error) {\n utils.callInNextTick(function () {\n throw error;\n });\n};\n\nfunction getTypedFormatter (type) {\n return function () {\n var id = arguments[0];\n var msg = CC_DEBUG ? (debugInfos[id] || 'unknown id') : `${type} ${id}, please go to ${ERROR_MAP_URL}#${id} to see details.`;\n if (arguments.length === 1) {\n return msg;\n }\n else if (arguments.length === 2) {\n return CC_DEBUG ? cc.js.formatStr(msg, arguments[1]) :\n msg + ' Arguments: ' + arguments[1];\n }\n else {\n var argsArray = cc.js.shiftArguments.apply(null, arguments);\n return CC_DEBUG ? cc.js.formatStr.apply(null, [msg].concat(argsArray)) :\n msg + ' Arguments: ' + argsArray.join(', ');\n }\n };\n}\n\nvar logFormatter = getTypedFormatter('Log');\ncc.logID = function () {\n cc.log(logFormatter.apply(null, arguments));\n};\n\nvar warnFormatter = getTypedFormatter('Warning');\ncc.warnID = function () {\n cc.warn(warnFormatter.apply(null, arguments));\n};\n\nvar errorFormatter = getTypedFormatter('Error');\ncc.errorID = function () {\n cc.error(errorFormatter.apply(null, arguments));\n};\n\nvar assertFormatter = getTypedFormatter('Assert');\ncc.assertID = function (cond) {\n 'use strict';\n if (cond) {\n return;\n }\n cc.assert(false, assertFormatter.apply(null, cc.js.shiftArguments.apply(null, arguments)));\n};\n\n/**\n* !#en Enum for debug modes.\n* !#zh 调试模式\n* @enum debug.DebugMode\n* @memberof cc\n */\nvar DebugMode = cc.Enum({\n /**\n * !#en The debug mode none.\n * !#zh 禁止模式,禁止显示任何日志信息。\n * @property NONE\n * @type {Number}\n * @static\n */\n NONE: 0,\n /**\n * !#en The debug mode info.\n * !#zh 信息模式,在 console 中显示所有日志。\n * @property INFO\n * @type {Number}\n * @static\n */\n INFO: 1,\n /**\n * !#en The debug mode warn.\n * !#zh 警告模式,在 console 中只显示 warn 级别以上的(包含 error)日志。\n * @property WARN\n * @type {Number}\n * @static\n */\n WARN: 2,\n /**\n * !#en The debug mode error.\n * !#zh 错误模式,在 console 中只显示 error 日志。\n * @property ERROR\n * @type {Number}\n * @static\n */\n ERROR: 3,\n /**\n * !#en The debug mode info for web page.\n * !#zh 信息模式(仅 WEB 端有效),在画面上输出所有信息。\n * @property INFO_FOR_WEB_PAGE\n * @type {Number}\n * @static\n */\n INFO_FOR_WEB_PAGE: 4,\n /**\n * !#en The debug mode warn for web page.\n * !#zh 警告模式(仅 WEB 端有效),在画面上输出 warn 级别以上的(包含 error)信息。\n * @property WARN_FOR_WEB_PAGE\n * @type {Number}\n * @static\n */\n WARN_FOR_WEB_PAGE: 5,\n /**\n * !#en The debug mode error for web page.\n * !#zh 错误模式(仅 WEB 端有效),在画面上输出 error 信息。\n * @property ERROR_FOR_WEB_PAGE\n * @type {Number}\n * @static\n */\n ERROR_FOR_WEB_PAGE: 6\n});\n/**\n * !#en An object to boot the game.\n * !#zh 包含游戏主体信息并负责驱动游戏的游戏对象。\n * @class debug\n * @main\n * @static\n */\nmodule.exports = cc.debug = {\n DebugMode: DebugMode,\n\n _resetDebugSetting: resetDebugSetting,\n\n /**\n * !#en Gets error message with the error id and possible parameters.\n * !#zh 通过 error id 和必要的参数来获取错误信息。\n * @method getError\n * @param {Number} errorId\n * @param {any} [param]\n * @return {String}\n */\n getError: getTypedFormatter('ERROR'),\n\n /**\n * !#en Returns whether or not to display the FPS informations.\n * !#zh 是否显示 FPS 信息。\n * @method isDisplayStats\n * @return {Boolean}\n */\n isDisplayStats: function () {\n return cc.profiler ? cc.profiler.isShowingStats() : false;\n },\n\n /**\n * !#en Sets whether display the FPS on the bottom-left corner.\n * !#zh 设置是否在左下角显示 FPS。\n * @method setDisplayStats\n * @param {Boolean} displayStats\n */\n setDisplayStats: function (displayStats) {\n if (cc.profiler && cc.game.renderType !== cc.game.RENDER_TYPE_CANVAS) {\n displayStats ? cc.profiler.showStats() : cc.profiler.hideStats();\n cc.game.config.showFPS = !!displayStats;\n }\n },\n}","/****************************************************************************\n Copyright (c) 2008-2010 Ricardo Quesada\n Copyright (c) 2011-2012 cocos2d-x.org\n Copyright (c) 2013-2016 Chukong Technologies Inc.\n Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\nconst EventTarget = require('./event/event-target');\nconst ComponentScheduler = require('./component-scheduler');\nconst NodeActivator = require('./node-activator');\nconst Obj = require('./platform/CCObject');\nconst game = require('./CCGame');\nconst renderer = require('./renderer');\nconst eventManager = require('./event-manager');\nconst Scheduler = require('./CCScheduler');\n\n//----------------------------------------------------------------------------------------------------------------------\n\n/**\n * !#en\n *
\n * cc.director is a singleton object which manage your game's logic flow.
\n * Since the cc.director is a singleton, you don't need to call any constructor or create functions,
\n * the standard way to use it is by calling:
\n * - cc.director.methodName();
\n *\n * It creates and handle the main Window and manages how and when to execute the Scenes.
\n *
\n * The cc.director is also responsible for:
\n * - initializing the OpenGL context
\n * - setting the OpenGL pixel format (default on is RGB565)
\n * - setting the OpenGL buffer depth (default on is 0-bit)
\n * - setting the color for clear screen (default one is BLACK)
\n * - setting the projection (default one is 3D)
\n * - setting the orientation (default one is Portrait)
\n *
\n *
\n * The cc.director also sets the default OpenGL context:
\n * - GL_TEXTURE_2D is enabled
\n * - GL_VERTEX_ARRAY is enabled
\n * - GL_COLOR_ARRAY is enabled
\n * - GL_TEXTURE_COORD_ARRAY is enabled
\n *
\n * Features and Limitations:
\n * - Scheduled timers & drawing are synchronizes with the refresh rate of the display
\n * - Only supports animation intervals of 1/60 1/30 & 1/15
\n *
\n * cc.director 一个管理你的游戏的逻辑流程的单例对象。
\n * 由于 cc.director 是一个单例,你不需要调用任何构造函数或创建函数,
\n * 使用它的标准方法是通过调用:
\n * - cc.director.methodName();\n *
\n * 它创建和处理主窗口并且管理什么时候执行场景。
\n *
\n * cc.director 还负责:
\n * - 初始化 OpenGL 环境。
\n * - 设置OpenGL像素格式。(默认是 RGB565)
\n * - 设置OpenGL缓冲区深度 (默认是 0-bit)
\n * - 设置空白场景的颜色 (默认是 黑色)
\n * - 设置投影 (默认是 3D)
\n * - 设置方向 (默认是 Portrait)
\n *
\n * cc.director 设置了 OpenGL 默认环境
\n * - GL_TEXTURE_2D 启用。
\n * - GL_VERTEX_ARRAY 启用。
\n * - GL_COLOR_ARRAY 启用。
\n * - GL_TEXTURE_COORD_ARRAY 启用。
\n *
\n * 特点和局限性:
\n * - 将计时器 & 渲染与显示器的刷新频率同步。
\n * - 只支持动画的间隔 1/60 1/30 & 1/15。
\n *
\n * Useful to convert (multi) touches coordinates to the current layout (portrait or landscape)
\n * Implementation can be found in CCDirectorWebGL.\n * !#zh 将触摸点的屏幕坐标转换为 WebGL View 下的坐标。\n * @method convertToGL\n * @param {Vec2} uiPoint\n * @return {Vec2}\n * @deprecated since v2.0\n */\n convertToGL: function (uiPoint) {\n var container = game.container;\n var view = cc.view;\n var box = container.getBoundingClientRect();\n var left = box.left + window.pageXOffset - container.clientLeft;\n var top = box.top + window.pageYOffset - container.clientTop;\n var x = view._devicePixelRatio * (uiPoint.x - left);\n var y = view._devicePixelRatio * (top + box.height - uiPoint.y);\n return view._isRotated ? cc.v2(view._viewportRect.width - y, x) : cc.v2(x, y);\n },\n\n /**\n * !#en\n * Converts an OpenGL coordinate to a view coordinate
\n * Useful to convert node points to window points for calls such as glScissor
\n * Implementation can be found in CCDirectorWebGL.\n * !#zh 将触摸点的 WebGL View 坐标转换为屏幕坐标。\n * @method convertToUI\n * @param {Vec2} glPoint\n * @return {Vec2}\n * @deprecated since v2.0\n */\n convertToUI: function (glPoint) {\n var container = game.container;\n var view = cc.view;\n var box = container.getBoundingClientRect();\n var left = box.left + window.pageXOffset - container.clientLeft;\n var top = box.top + window.pageYOffset - container.clientTop;\n var uiPoint = cc.v2(0, 0);\n if (view._isRotated) {\n uiPoint.x = left + glPoint.y / view._devicePixelRatio;\n uiPoint.y = top + box.height - (view._viewportRect.width - glPoint.x) / view._devicePixelRatio;\n }\n else {\n uiPoint.x = left + glPoint.x * view._devicePixelRatio;\n uiPoint.y = top + box.height - glPoint.y * view._devicePixelRatio;\n }\n return uiPoint;\n },\n\n /**\n * End the life of director in the next frame\n * @method end\n */\n end: function () {\n this._purgeDirectorInNextLoop = true;\n },\n\n /**\n * !#en\n * Returns the size of the WebGL view in points.
\n * It takes into account any possible rotation (device orientation) of the window.\n * !#zh 获取视图的大小,以点为单位。\n * @method getWinSize\n * @return {Size}\n * @deprecated since v2.0\n */\n getWinSize: function () {\n return cc.size(cc.winSize);\n },\n\n /**\n * !#en\n * Returns the size of the OpenGL view in pixels.
\n * It takes into account any possible rotation (device orientation) of the window.
\n * On Mac winSize and winSizeInPixels return the same value.\n * (The pixel here refers to the resource resolution. If you want to get the physics resolution of device, you need to use cc.view.getFrameSize())\n * !#zh\n * 获取视图大小,以像素为单位(这里的像素指的是资源分辨率。\n * 如果要获取屏幕物理分辨率,需要用 cc.view.getFrameSize())\n * @method getWinSizeInPixels\n * @return {Size}\n * @deprecated since v2.0\n */\n getWinSizeInPixels: function () {\n return cc.size(cc.winSize);\n },\n\n /**\n * !#en Pause the director's ticker, only involve the game logic execution.\n * It won't pause the rendering process nor the event manager.\n * If you want to pause the entier game including rendering, audio and event, \n * please use {{#crossLink \"Game.pause\"}}cc.game.pause{{/crossLink}}\n * !#zh 暂停正在运行的场景,该暂停只会停止游戏逻辑执行,但是不会停止渲染和 UI 响应。\n * 如果想要更彻底得暂停游戏,包含渲染,音频和事件,请使用 {{#crossLink \"Game.pause\"}}cc.game.pause{{/crossLink}}。\n * @method pause\n */\n pause: function () {\n if (this._paused)\n return;\n this._paused = true;\n },\n\n /**\n * Removes cached all cocos2d cached data.\n * @deprecated since v2.0\n */\n purgeCachedData: function () {\n cc.assetManager.releaseAll();\n },\n\n /**\n * Purge the cc.director itself, including unschedule all schedule, remove all event listeners, clean up and exit the running scene, stops all animations, clear cached data.\n */\n purgeDirector: function () {\n //cleanup scheduler\n this._scheduler.unscheduleAll();\n this._compScheduler.unscheduleAll();\n\n this._nodeActivator.reset();\n\n // Disable event dispatching\n if (eventManager)\n eventManager.setEnabled(false);\n\n if (!CC_EDITOR) {\n if (cc.isValid(this._scene)) {\n this._scene.destroy();\n }\n this._scene = null;\n\n cc.renderer.clear();\n cc.assetManager.builtins.clear();\n }\n\n cc.game.pause();\n\n // Clear all caches\n cc.assetManager.releaseAll();\n },\n\n /**\n * Reset the cc.director, can be used to restart the director after purge\n */\n reset: function () {\n this.purgeDirector();\n\n if (eventManager)\n eventManager.setEnabled(true);\n\n // Action manager\n if (this._actionManager){\n this._scheduler.scheduleUpdate(this._actionManager, cc.Scheduler.PRIORITY_SYSTEM, false);\n }\n\n // Animation manager\n if (this._animationManager) {\n this._scheduler.scheduleUpdate(this._animationManager, cc.Scheduler.PRIORITY_SYSTEM, false);\n }\n\n // Collider manager\n if (this._collisionManager) {\n this._scheduler.scheduleUpdate(this._collisionManager, cc.Scheduler.PRIORITY_SYSTEM, false);\n }\n\n // Physics manager\n if (this._physicsManager) {\n this._scheduler.scheduleUpdate(this._physicsManager, cc.Scheduler.PRIORITY_SYSTEM, false);\n }\n\n cc.game.resume();\n },\n\n /**\n * !#en\n * Run a scene. Replaces the running scene with a new one or enter the first scene.
\n * The new scene will be launched immediately.\n * !#zh 立刻切换指定场景。\n * @method runSceneImmediate\n * @param {Scene|SceneAsset} scene - The need run scene.\n * @param {Function} [onBeforeLoadScene] - The function invoked at the scene before loading.\n * @param {Function} [onLaunched] - The function invoked at the scene after launch.\n */\n runSceneImmediate: function (scene, onBeforeLoadScene, onLaunched) {\n cc.assertID(scene instanceof cc.Scene || scene instanceof cc.SceneAsset, 1216);\n\n if (scene instanceof cc.SceneAsset) scene = scene.scene;\n\n CC_BUILD && CC_DEBUG && console.time('InitScene');\n scene._load(); // ensure scene initialized\n CC_BUILD && CC_DEBUG && console.timeEnd('InitScene');\n\n // Re-attach or replace persist nodes\n CC_BUILD && CC_DEBUG && console.time('AttachPersist');\n var persistNodeList = Object.keys(game._persistRootNodes).map(function (x) {\n return game._persistRootNodes[x];\n });\n for (let i = 0; i < persistNodeList.length; i++) {\n let node = persistNodeList[i];\n var existNode = scene.getChildByUuid(node.uuid);\n if (existNode) {\n // scene also contains the persist node, select the old one\n var index = existNode.getSiblingIndex();\n existNode._destroyImmediate();\n scene.insertChild(node, index);\n }\n else {\n node.parent = scene;\n }\n }\n CC_BUILD && CC_DEBUG && console.timeEnd('AttachPersist');\n\n var oldScene = this._scene;\n if (!CC_EDITOR) {\n // auto release assets\n CC_BUILD && CC_DEBUG && console.time('AutoRelease');\n cc.assetManager._releaseManager._autoRelease(oldScene, scene, game._persistRootNodes);\n CC_BUILD && CC_DEBUG && console.timeEnd('AutoRelease');\n }\n\n // unload scene\n CC_BUILD && CC_DEBUG && console.time('Destroy');\n if (cc.isValid(oldScene)) {\n oldScene.destroy();\n }\n\n this._scene = null;\n\n // purge destroyed nodes belongs to old scene\n Obj._deferredDestroy();\n CC_BUILD && CC_DEBUG && console.timeEnd('Destroy');\n\n if (onBeforeLoadScene) {\n onBeforeLoadScene();\n }\n this.emit(cc.Director.EVENT_BEFORE_SCENE_LAUNCH, scene);\n\n // Run an Entity Scene\n this._scene = scene;\n\n CC_BUILD && CC_DEBUG && console.time('Activate');\n scene._activate();\n CC_BUILD && CC_DEBUG && console.timeEnd('Activate');\n\n //start scene\n cc.game.resume();\n\n if (onLaunched) {\n onLaunched(null, scene);\n }\n this.emit(cc.Director.EVENT_AFTER_SCENE_LAUNCH, scene);\n },\n\n /**\n * !#en\n * Run a scene. Replaces the running scene with a new one or enter the first scene.\n * The new scene will be launched at the end of the current frame.\n * !#zh 运行指定场景。\n * @method runScene\n * @param {Scene|SceneAsset} scene - The need run scene.\n * @param {Function} [onBeforeLoadScene] - The function invoked at the scene before loading.\n * @param {Function} [onLaunched] - The function invoked at the scene after launch.\n */\n runScene: function (scene, onBeforeLoadScene, onLaunched) {\n cc.assertID(scene, 1205);\n cc.assertID(scene instanceof cc.Scene || scene instanceof cc.SceneAsset, 1216);\n\n if (scene instanceof cc.SceneAsset) scene = scene.scene;\n // ensure scene initialized\n scene._load();\n\n // Delay run / replace scene to the end of the frame\n this.once(cc.Director.EVENT_AFTER_DRAW, function () {\n this.runSceneImmediate(scene, onBeforeLoadScene, onLaunched);\n }, this);\n },\n\n /**\n * !#en Loads the scene by its name.\n * !#zh 通过场景名称进行加载场景。\n *\n * @method loadScene\n * @param {String} sceneName - The name of the scene to load.\n * @param {Function} [onLaunched] - callback, will be called after scene launched.\n * @return {Boolean} if error, return false\n */\n loadScene: function (sceneName, onLaunched, _onUnloaded) {\n if (this._loadingScene) {\n cc.warnID(1208, sceneName, this._loadingScene);\n return false;\n }\n var bundle = cc.assetManager.bundles.find(function (bundle) {\n return bundle.getSceneInfo(sceneName);\n });\n if (bundle) {\n this.emit(cc.Director.EVENT_BEFORE_SCENE_LOADING, sceneName);\n this._loadingScene = sceneName;\n var self = this;\n console.time('LoadScene ' + sceneName);\n bundle.loadScene(sceneName, function (err, scene) {\n console.timeEnd('LoadScene ' + sceneName);\n self._loadingScene = '';\n if (err) {\n err = 'Failed to load scene: ' + err;\n cc.error(err);\n onLaunched && onLaunched(err);\n }\n else {\n self.runSceneImmediate(scene, _onUnloaded, onLaunched);\n }\n });\n return true;\n }\n else {\n cc.errorID(1209, sceneName);\n return false;\n }\n },\n\n /**\n * !#en\n * Preloads the scene to reduces loading time. You can call this method at any time you want.\n * After calling this method, you still need to launch the scene by `cc.director.loadScene`.\n * It will be totally fine to call `cc.director.loadScene` at any time even if the preloading is not\n * yet finished, the scene will be launched after loaded automatically.\n * !#zh 预加载场景,你可以在任何时候调用这个方法。\n * 调用完后,你仍然需要通过 `cc.director.loadScene` 来启动场景,因为这个方法不会执行场景加载操作。\n * 就算预加载还没完成,你也可以直接调用 `cc.director.loadScene`,加载完成后场景就会启动。\n *\n * @method preloadScene\n * @param {String} sceneName - The name of the scene to preload.\n * @param {Function} [onProgress] - callback, will be called when the load progression change.\n * @param {Number} onProgress.completedCount - The number of the items that are already completed\n * @param {Number} onProgress.totalCount - The total number of the items\n * @param {Object} onProgress.item - The latest item which flow out the pipeline\n * @param {Function} [onLoaded] - callback, will be called after scene loaded.\n * @param {Error} onLoaded.error - null or the error object.\n */\n preloadScene (sceneName, onProgress, onLoaded) {\n var bundle = cc.assetManager.bundles.find(function (bundle) {\n return bundle.getSceneInfo(sceneName);\n });\n if (bundle) {\n bundle.preloadScene(sceneName, null, onProgress, onLoaded);\n }\n else {\n cc.errorID(1209, sceneName);\n return null;\n }\n },\n\n\n /**\n * !#en Resume game logic execution after pause, if the current scene is not paused, nothing will happen.\n * !#zh 恢复暂停场景的游戏逻辑,如果当前场景没有暂停将没任何事情发生。\n * @method resume\n */\n resume: function () {\n if (!this._paused) {\n return;\n }\n\n this._lastUpdate = performance.now();\n if (!this._lastUpdate) {\n cc.logID(1200);\n }\n\n this._paused = false;\n this._deltaTime = 0;\n },\n\n /**\n * !#en\n * Enables or disables WebGL depth test.
\n * Implementation can be found in CCDirectorCanvas.js/CCDirectorWebGL.js\n * !#zh 启用/禁用深度测试(在 Canvas 渲染模式下不会生效)。\n * @method setDepthTest\n * @param {Boolean} on\n * @deprecated since v2.0\n */\n setDepthTest: function (value) {\n if (!cc.Camera.main) {\n return;\n }\n cc.Camera.main.depth = !!value;\n },\n\n /**\n * !#en\n * Set color for clear screen.
\n * (Implementation can be found in CCDirectorCanvas.js/CCDirectorWebGL.js)\n * !#zh\n * 设置场景的默认擦除颜色。
\n * 支持全透明,但不支持透明度为中间值。要支持全透明需手工开启 cc.macro.ENABLE_TRANSPARENT_CANVAS。\n * @method setClearColor\n * @param {Color} clearColor\n * @deprecated since v2.0\n */\n setClearColor: function (clearColor) {\n if (!cc.Camera.main) {\n return;\n }\n cc.Camera.main.backgroundColor = clearColor;\n },\n\n /**\n * !#en Returns current logic Scene.\n * !#zh 获取当前逻辑场景。\n * @method getRunningScene\n * @private\n * @return {Scene}\n * @deprecated since v2.0\n */\n getRunningScene: function () {\n return this._scene;\n },\n\n /**\n * !#en Returns current logic Scene.\n * !#zh 获取当前逻辑场景。\n * @method getScene\n * @return {Scene}\n * @example\n * // This will help you to get the Canvas node in scene\n * cc.director.getScene().getChildByName('Canvas');\n */\n getScene: function () {\n return this._scene;\n },\n\n /**\n * !#en Returns the FPS value. Please use {{#crossLink \"Game.setFrameRate\"}}cc.game.setFrameRate{{/crossLink}} to control animation interval.\n * !#zh 获取单位帧执行时间。请使用 {{#crossLink \"Game.setFrameRate\"}}cc.game.setFrameRate{{/crossLink}} 来控制游戏帧率。\n * @method getAnimationInterval\n * @deprecated since v2.0\n * @return {Number}\n */\n getAnimationInterval: function () {\n return 1000 / game.getFrameRate();\n },\n\n /**\n * Sets animation interval, this doesn't control the main loop.\n * To control the game's frame rate overall, please use {{#crossLink \"Game.setFrameRate\"}}cc.game.setFrameRate{{/crossLink}}\n * @method setAnimationInterval\n * @deprecated since v2.0\n * @param {Number} value - The animation interval desired.\n */\n setAnimationInterval: function (value) {\n game.setFrameRate(Math.round(1000 / value));\n },\n\n /**\n * !#en Returns the delta time since last frame.\n * !#zh 获取上一帧的增量时间。\n * @method getDeltaTime\n * @return {Number}\n */\n getDeltaTime: function () {\n return this._deltaTime;\n },\n\n /**\n * !#en Returns the total passed time since game start, unit: ms\n * !#zh 获取从游戏开始到现在总共经过的时间,单位为 ms\n * @method getTotalTime\n * @return {Number}\n */\n getTotalTime: function () {\n return performance.now() - this._startTime;\n },\n\n /**\n * !#en Returns how many frames were called since the director started.\n * !#zh 获取 director 启动以来游戏运行的总帧数。\n * @method getTotalFrames\n * @return {Number}\n */\n getTotalFrames: function () {\n return this._totalFrames;\n },\n\n /**\n * !#en Returns whether or not the Director is paused.\n * !#zh 是否处于暂停状态。\n * @method isPaused\n * @return {Boolean}\n */\n isPaused: function () {\n return this._paused;\n },\n\n /**\n * !#en Returns the cc.Scheduler associated with this director.\n * !#zh 获取和 director 相关联的 cc.Scheduler。\n * @method getScheduler\n * @return {Scheduler}\n */\n getScheduler: function () {\n return this._scheduler;\n },\n\n /**\n * !#en Sets the cc.Scheduler associated with this director.\n * !#zh 设置和 director 相关联的 cc.Scheduler。\n * @method setScheduler\n * @param {Scheduler} scheduler\n */\n setScheduler: function (scheduler) {\n if (this._scheduler !== scheduler) {\n this._scheduler = scheduler;\n }\n },\n\n /**\n * !#en Returns the cc.ActionManager associated with this director.\n * !#zh 获取和 director 相关联的 cc.ActionManager(动作管理器)。\n * @method getActionManager\n * @return {ActionManager}\n */\n getActionManager: function () {\n return this._actionManager;\n },\n /**\n * !#en Sets the cc.ActionManager associated with this director.\n * !#zh 设置和 director 相关联的 cc.ActionManager(动作管理器)。\n * @method setActionManager\n * @param {ActionManager} actionManager\n */\n setActionManager: function (actionManager) {\n if (this._actionManager !== actionManager) {\n if (this._actionManager) {\n this._scheduler.unscheduleUpdate(this._actionManager);\n }\n this._actionManager = actionManager;\n this._scheduler.scheduleUpdate(this._actionManager, cc.Scheduler.PRIORITY_SYSTEM, false);\n }\n },\n\n /* \n * !#en Returns the cc.AnimationManager associated with this director.\n * !#zh 获取和 director 相关联的 cc.AnimationManager(动画管理器)。\n * @method getAnimationManager\n * @return {AnimationManager}\n */\n getAnimationManager: function () {\n return this._animationManager;\n },\n\n /**\n * !#en Returns the cc.CollisionManager associated with this director.\n * !#zh 获取和 director 相关联的 cc.CollisionManager (碰撞管理器)。\n * @method getCollisionManager\n * @return {CollisionManager}\n */\n getCollisionManager: function () {\n return this._collisionManager;\n },\n\n /**\n * !#en Returns the cc.PhysicsManager associated with this director.\n * !#zh 返回与 director 相关联的 cc.PhysicsManager (物理管理器)。\n * @method getPhysicsManager\n * @return {PhysicsManager}\n */\n getPhysicsManager: function () {\n return this._physicsManager;\n },\n\n /**\n * !#en Returns the cc.Physics3DManager associated with this director.\n * !#zh 返回与 director 相关联的 cc.Physics3DManager (物理管理器)。\n * @method getPhysics3DManager\n * @return {Physics3DManager}\n */\n getPhysics3DManager: function () {\n return this._physics3DManager;\n },\n\n // Loop management\n /*\n * Starts Animation\n * @deprecated since v2.1.2\n */\n startAnimation: function () {\n cc.game.resume();\n },\n\n /*\n * Stops animation\n * @deprecated since v2.1.2\n */\n stopAnimation: function () {\n cc.game.pause();\n },\n\n _resetDeltaTime () {\n this._lastUpdate = performance.now();\n this._deltaTime = 0;\n },\n\n /*\n * Run main loop of director\n */\n mainLoop: CC_EDITOR ? function (deltaTime, updateAnimate) {\n this._deltaTime = deltaTime;\n\n // Update\n if (!this._paused) {\n this.emit(cc.Director.EVENT_BEFORE_UPDATE);\n\n this._compScheduler.startPhase();\n this._compScheduler.updatePhase(deltaTime);\n\n if (updateAnimate) {\n this._scheduler.update(deltaTime);\n }\n\n this._compScheduler.lateUpdatePhase(deltaTime);\n\n this.emit(cc.Director.EVENT_AFTER_UPDATE);\n }\n\n // Render\n this.emit(cc.Director.EVENT_BEFORE_DRAW);\n renderer.render(this._scene, deltaTime);\n \n // After draw\n this.emit(cc.Director.EVENT_AFTER_DRAW);\n\n this._totalFrames++;\n\n } : function (now) {\n if (this._purgeDirectorInNextLoop) {\n this._purgeDirectorInNextLoop = false;\n this.purgeDirector();\n }\n else {\n // calculate \"global\" dt\n this.calculateDeltaTime(now);\n\n // Update\n if (!this._paused) {\n // before update\n this.emit(cc.Director.EVENT_BEFORE_UPDATE);\n\n // Call start for new added components\n this._compScheduler.startPhase();\n\n // Update for components\n this._compScheduler.updatePhase(this._deltaTime);\n // Engine update with scheduler\n this._scheduler.update(this._deltaTime);\n\n // Late update for components\n this._compScheduler.lateUpdatePhase(this._deltaTime);\n\n // User can use this event to do things after update\n this.emit(cc.Director.EVENT_AFTER_UPDATE);\n \n // Destroy entities that have been removed recently\n Obj._deferredDestroy();\n }\n\n // Render\n this.emit(cc.Director.EVENT_BEFORE_DRAW);\n renderer.render(this._scene, this._deltaTime);\n\n // After draw\n this.emit(cc.Director.EVENT_AFTER_DRAW);\n\n eventManager.frameUpdateListeners();\n this._totalFrames++;\n }\n },\n\n __fastOn: function (type, callback, target) {\n this.on(type, callback, target);\n },\n\n __fastOff: function (type, callback, target) {\n this.off(type, callback, target);\n },\n};\n\n// Event target\ncc.js.addon(cc.Director.prototype, EventTarget.prototype);\n\n/**\n * !#en The event projection changed of cc.Director. This event will not get triggered since v2.0\n * !#zh cc.Director 投影变化的事件。从 v2.0 开始这个事件不会再被触发\n * @property {String} EVENT_PROJECTION_CHANGED\n * @readonly\n * @static\n * @deprecated since v2.0\n */\ncc.Director.EVENT_PROJECTION_CHANGED = \"director_projection_changed\";\n\n/**\n * !#en The event which will be triggered before loading a new scene.\n * !#zh 加载新场景之前所触发的事件。\n * @event cc.Director.EVENT_BEFORE_SCENE_LOADING\n * @param {String} sceneName - The loading scene name\n */\n/**\n * !#en The event which will be triggered before loading a new scene.\n * !#zh 加载新场景之前所触发的事件。\n * @property {String} EVENT_BEFORE_SCENE_LOADING\n * @readonly\n * @static\n */\ncc.Director.EVENT_BEFORE_SCENE_LOADING = \"director_before_scene_loading\";\n\n/*\n * !#en The event which will be triggered before launching a new scene.\n * !#zh 运行新场景之前所触发的事件。\n * @event cc.Director.EVENT_BEFORE_SCENE_LAUNCH\n * @param {String} sceneName - New scene which will be launched\n */\n/**\n * !#en The event which will be triggered before launching a new scene.\n * !#zh 运行新场景之前所触发的事件。\n * @property {String} EVENT_BEFORE_SCENE_LAUNCH\n * @readonly\n * @static\n */\ncc.Director.EVENT_BEFORE_SCENE_LAUNCH = \"director_before_scene_launch\";\n\n/**\n * !#en The event which will be triggered after launching a new scene.\n * !#zh 运行新场景之后所触发的事件。\n * @event cc.Director.EVENT_AFTER_SCENE_LAUNCH\n * @param {String} sceneName - New scene which is launched\n */\n/**\n * !#en The event which will be triggered after launching a new scene.\n * !#zh 运行新场景之后所触发的事件。\n * @property {String} EVENT_AFTER_SCENE_LAUNCH\n * @readonly\n * @static\n */\ncc.Director.EVENT_AFTER_SCENE_LAUNCH = \"director_after_scene_launch\";\n\n/**\n * !#en The event which will be triggered at the beginning of every frame.\n * !#zh 每个帧的开始时所触发的事件。\n * @event cc.Director.EVENT_BEFORE_UPDATE\n */\n/**\n * !#en The event which will be triggered at the beginning of every frame.\n * !#zh 每个帧的开始时所触发的事件。\n * @property {String} EVENT_BEFORE_UPDATE\n * @readonly\n * @static\n */\ncc.Director.EVENT_BEFORE_UPDATE = \"director_before_update\";\n\n/**\n * !#en The event which will be triggered after engine and components update logic.\n * !#zh 将在引擎和组件 “update” 逻辑之后所触发的事件。\n * @event cc.Director.EVENT_AFTER_UPDATE\n */\n/**\n * !#en The event which will be triggered after engine and components update logic.\n * !#zh 将在引擎和组件 “update” 逻辑之后所触发的事件。\n * @property {String} EVENT_AFTER_UPDATE\n * @readonly\n * @static\n */\ncc.Director.EVENT_AFTER_UPDATE = \"director_after_update\";\n\n/**\n * !#en The event is deprecated since v2.0, please use cc.Director.EVENT_BEFORE_DRAW instead\n * !#zh 这个事件从 v2.0 开始被废弃,请直接使用 cc.Director.EVENT_BEFORE_DRAW\n * @property {String} EVENT_BEFORE_VISIT\n * @readonly\n * @deprecated since v2.0\n * @static\n */\ncc.Director.EVENT_BEFORE_VISIT = \"director_before_draw\";\n\n/**\n * !#en The event is deprecated since v2.0, please use cc.Director.EVENT_BEFORE_DRAW instead\n * !#zh 这个事件从 v2.0 开始被废弃,请直接使用 cc.Director.EVENT_BEFORE_DRAW\n * @property {String} EVENT_AFTER_VISIT\n * @readonly\n * @deprecated since v2.0\n * @static\n */\ncc.Director.EVENT_AFTER_VISIT = \"director_before_draw\";\n\n/**\n * !#en The event which will be triggered before the rendering process.\n * !#zh 渲染过程之前所触发的事件。\n * @event cc.Director.EVENT_BEFORE_DRAW\n */\n/**\n * !#en The event which will be triggered before the rendering process.\n * !#zh 渲染过程之前所触发的事件。\n * @property {String} EVENT_BEFORE_DRAW\n * @readonly\n * @static\n */\ncc.Director.EVENT_BEFORE_DRAW = \"director_before_draw\";\n\n/**\n * !#en The event which will be triggered after the rendering process.\n * !#zh 渲染过程之后所触发的事件。\n * @event cc.Director.EVENT_AFTER_DRAW\n */\n/**\n * !#en The event which will be triggered after the rendering process.\n * !#zh 渲染过程之后所触发的事件。\n * @property {String} EVENT_AFTER_DRAW\n * @readonly\n * @static\n */\ncc.Director.EVENT_AFTER_DRAW = \"director_after_draw\";\n\n//Possible OpenGL projections used by director\n\n/**\n * Constant for 2D projection (orthogonal projection)\n * @property {Number} PROJECTION_2D\n * @default 0\n * @readonly\n * @static\n * @deprecated since v2.0\n */\ncc.Director.PROJECTION_2D = 0;\n\n/**\n * Constant for 3D projection with a fovy=60, znear=0.5f and zfar=1500.\n * @property {Number} PROJECTION_3D\n * @default 1\n * @readonly\n * @static\n * @deprecated since v2.0\n */\ncc.Director.PROJECTION_3D = 1;\n\n/**\n * Constant for custom projection, if cc.Director's projection set to it, it calls \"updateProjection\" on the projection delegate.\n * @property {Number} PROJECTION_CUSTOM\n * @default 3\n * @readonly\n * @static\n * @deprecated since v2.0\n */\ncc.Director.PROJECTION_CUSTOM = 3;\n\n/**\n * Constant for default projection of cc.Director, default projection is 2D projection\n * @property {Number} PROJECTION_DEFAULT\n * @default cc.Director.PROJECTION_2D\n * @readonly\n * @static\n * @deprecated since v2.0\n */\ncc.Director.PROJECTION_DEFAULT = cc.Director.PROJECTION_2D;\n\n/**\n * The event which will be triggered before the physics process.
\n * 物理过程之前所触发的事件。\n * @event Director.EVENT_BEFORE_PHYSICS\n * @readonly\n */\ncc.Director.EVENT_BEFORE_PHYSICS = 'director_before_physics';\n\n/**\n * The event which will be triggered after the physics process.
\n * 物理过程之后所触发的事件。\n * @event Director.EVENT_AFTER_PHYSICS\n * @readonly\n */\ncc.Director.EVENT_AFTER_PHYSICS = 'director_after_physics';\n\n/**\n * @module cc\n */\n\n/**\n * !#en Director\n * !#zh 导演类。\n * @property director\n * @type {Director}\n */\ncc.director = new cc.Director();\n\nmodule.exports = cc.director;","/****************************************************************************\n Copyright (c) 2013-2016 Chukong Technologies Inc.\n Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.\n\n https://www.cocos.com/\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated engine source code (the \"Software\"), a limited,\n worldwide, royalty-free, non-assignable, revocable and non-exclusive license\n to use Cocos Creator solely to develop games on your target platforms. You shall\n not use Cocos Creator software for developing other software or tools that's\n used for developing games. You are not granted to publish, distribute,\n sublicense, and/or sell copies of Cocos Creator.\n\n The software or tools in this License Agreement are licensed, not sold.\n Xiamen Yaji Software Co., Ltd. reserves all rights not expressly granted to you.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\nvar EventTarget = require('./event/event-target');\nrequire('../audio/CCAudioEngine');\nconst debug = require('./CCDebug');\nconst renderer = require('./renderer/index.js');\nconst dynamicAtlasManager = require('../core/renderer/utils/dynamic-atlas/manager');\n\n/**\n * @module cc\n */\n\n/**\n * !#en An object to boot the game.\n * !#zh 包含游戏主体信息并负责驱动游戏的游戏对象。\n * @class Game\n * @extends EventTarget\n */\nvar game = {\n /**\n * !#en Event triggered when game hide to background.\n * Please note that this event is not 100% guaranteed to be fired on Web platform,\n * on native platforms, it corresponds to enter background event, os status bar or notification center may not trigger this event.\n * !#zh 游戏进入后台时触发的事件。\n * 请注意,在 WEB 平台,这个事件不一定会 100% 触发,这完全取决于浏览器的回调行为。\n * 在原生平台,它对应的是应用被切换到后台事件,下拉菜单和上拉状态栏等不一定会触发这个事件,这取决于系统行为。\n * @property EVENT_HIDE\n * @type {String}\n * @example\n * cc.game.on(cc.game.EVENT_HIDE, function () {\n * cc.audioEngine.pauseMusic();\n * cc.audioEngine.pauseAllEffects();\n * });\n */\n EVENT_HIDE: \"game_on_hide\",\n\n /**\n * !#en Event triggered when game back to foreground\n * Please note that this event is not 100% guaranteed to be fired on Web platform,\n * on native platforms, it corresponds to enter foreground event.\n * !#zh 游戏进入前台运行时触发的事件。\n * 请注意,在 WEB 平台,这个事件不一定会 100% 触发,这完全取决于浏览器的回调行为。\n * 在原生平台,它对应的是应用被切换到前台事件。\n * @property EVENT_SHOW\n * @constant\n * @type {String}\n */\n EVENT_SHOW: \"game_on_show\",\n\n /**\n * !#en Event triggered when game restart\n * !#zh 调用restart后,触发事件。\n * @property EVENT_RESTART\n * @constant\n * @type {String}\n */\n EVENT_RESTART: \"game_on_restart\",\n\n /**\n * Event triggered after game inited, at this point all engine objects and game scripts are loaded\n * @property EVENT_GAME_INITED\n * @constant\n * @type {String}\n */\n EVENT_GAME_INITED: \"game_inited\",\n\n /**\n * Event triggered after engine inited, at this point you will be able to use all engine classes.\n * It was defined as EVENT_RENDERER_INITED in cocos creator v1.x and renamed in v2.0\n * @property EVENT_ENGINE_INITED\n * @constant\n * @type {String}\n */\n EVENT_ENGINE_INITED: \"engine_inited\",\n // deprecated\n EVENT_RENDERER_INITED: \"engine_inited\",\n\n /**\n * Web Canvas 2d API as renderer backend\n * @property RENDER_TYPE_CANVAS\n * @constant\n * @type {Number}\n */\n RENDER_TYPE_CANVAS: 0,\n /**\n * WebGL API as renderer backend\n * @property RENDER_TYPE_WEBGL\n * @constant\n * @type {Number}\n */\n RENDER_TYPE_WEBGL: 1,\n /**\n * OpenGL API as renderer backend\n * @property RENDER_TYPE_OPENGL\n * @constant\n * @type {Number}\n */\n RENDER_TYPE_OPENGL: 2,\n\n _persistRootNodes: {},\n\n // states\n _paused: true,//whether the game is paused\n _configLoaded: false,//whether config loaded\n _isCloning: false, // deserializing or instantiating\n _prepared: false, //whether the engine has prepared\n _rendererInitialized: false,\n\n _renderContext: null,\n\n _intervalId: null,//interval target of main\n\n _lastTime: null,\n _frameTime: null,\n\n /**\n * !#en The outer frame of the game canvas, parent of game container.\n * !#zh 游戏画布的外框,container 的父容器。\n * @property frame\n * @type {Object}\n */\n frame: null,\n /**\n * !#en The container of game canvas.\n * !#zh 游戏画布的容器。\n * @property container\n * @type {HTMLDivElement}\n */\n container: null,\n /**\n * !#en The canvas of the game.\n * !#zh 游戏的画布。\n * @property canvas\n * @type {HTMLCanvasElement}\n */\n canvas: null,\n\n /**\n * !#en The renderer backend of the game.\n * !#zh 游戏的渲染器类型。\n * @property renderType\n * @type {Number}\n */\n renderType: -1,\n\n /**\n * !#en\n * The current game configuration, including:
\n * 1. debugMode
\n * \"debugMode\" possible values :
\n * 0 - No message will be printed.
\n * 1 - cc.error, cc.assert, cc.warn, cc.log will print in console.
\n * 2 - cc.error, cc.assert, cc.warn will print in console.
\n * 3 - cc.error, cc.assert will print in console.
\n * 4 - cc.error, cc.assert, cc.warn, cc.log will print on canvas, available only on web.
\n * 5 - cc.error, cc.assert, cc.warn will print on canvas, available only on web.
\n * 6 - cc.error, cc.assert will print on canvas, available only on web.
\n * 2. showFPS
\n * Left bottom corner fps information will show when \"showFPS\" equals true, otherwise it will be hide.
\n * 3. exposeClassName
\n * Expose class name to chrome debug tools, the class intantiate performance is a little bit slower when exposed.
\n * 4. frameRate
\n * \"frameRate\" set the wanted frame rate for your game, but the real fps depends on your game implementation and the running environment.
\n * 5. id
\n * \"gameCanvas\" sets the id of your canvas element on the web page, it's useful only on web.
\n * 6. renderMode
\n * \"renderMode\" sets the renderer type, only useful on web :
\n * 0 - Automatically chosen by engine
\n * 1 - Forced to use canvas renderer
\n * 2 - Forced to use WebGL renderer, but this will be ignored on mobile browsers
\n *
\n * Please DO NOT modify this object directly, it won't have any effect.
\n * !#zh\n * 当前的游戏配置,包括:
\n * 1. debugMode(debug 模式,但是在浏览器中这个选项会被忽略)
\n * \"debugMode\" 各种设置选项的意义。
\n * 0 - 没有消息被打印出来。
\n * 1 - cc.error,cc.assert,cc.warn,cc.log 将打印在 console 中。
\n * 2 - cc.error,cc.assert,cc.warn 将打印在 console 中。
\n * 3 - cc.error,cc.assert 将打印在 console 中。
\n * 4 - cc.error,cc.assert,cc.warn,cc.log 将打印在 canvas 中(仅适用于 web 端)。
\n * 5 - cc.error,cc.assert,cc.warn 将打印在 canvas 中(仅适用于 web 端)。
\n * 6 - cc.error,cc.assert 将打印在 canvas 中(仅适用于 web 端)。
\n * 2. showFPS(显示 FPS)
\n * 当 showFPS 为 true 的时候界面的左下角将显示 fps 的信息,否则被隐藏。
\n * 3. exposeClassName
\n * 暴露类名让 Chrome DevTools 可以识别,如果开启会稍稍降低类的创建过程的性能,但对对象构造没有影响。
\n * 4. frameRate (帧率)
\n * “frameRate” 设置想要的帧率你的游戏,但真正的FPS取决于你的游戏实现和运行环境。
\n * 5. id
\n * \"gameCanvas\" Web 页面上的 Canvas Element ID,仅适用于 web 端。
\n * 6. renderMode(渲染模式)
\n * “renderMode” 设置渲染器类型,仅适用于 web 端:
\n * 0 - 通过引擎自动选择。
\n * 1 - 强制使用 canvas 渲染。\n * 2 - 强制使用 WebGL 渲染,但是在部分 Android 浏览器中这个选项会被忽略。
\n *
\n * 注意:请不要直接修改这个对象,它不会有任何效果。\n * @property config\n * @type {Object}\n */\n config: null,\n\n /**\n * !#en Callback when the scripts of engine have been load.\n * !#zh 当引擎完成启动后的回调函数。\n * @method onStart\n * @type {Function}\n */\n onStart: null,\n\n//@Public Methods\n\n// @Game play control\n /**\n * !#en Set frame rate of game.\n * !#zh 设置游戏帧率。\n * @method setFrameRate\n * @param {Number} frameRate\n */\n setFrameRate: function (frameRate) {\n var config = this.config;\n config.frameRate = frameRate;\n if (this._intervalId)\n window.cancelAnimFrame(this._intervalId);\n this._intervalId = 0;\n this._paused = true;\n this._setAnimFrame();\n this._runMainLoop();\n },\n\n /**\n * !#en Get frame rate set for the game, it doesn't represent the real frame rate.\n * !#zh 获取设置的游戏帧率(不等同于实际帧率)。\n * @method getFrameRate\n * @return {Number} frame rate\n */\n getFrameRate: function () {\n return this.config.frameRate;\n },\n\n /**\n * !#en Run the game frame by frame.\n * !#zh 执行一帧游戏循环。\n * @method step\n */\n step: function () {\n cc.director.mainLoop();\n },\n\n /**\n * !#en Pause the game main loop. This will pause:\n * game logic execution, rendering process, event manager, background music and all audio effects.\n * This is different with cc.director.pause which only pause the game logic execution.\n * !#zh 暂停游戏主循环。包含:游戏逻辑,渲染,事件处理,背景音乐和所有音效。这点和只暂停游戏逻辑的 cc.director.pause 不同。\n * @method pause\n */\n pause: function () {\n if (this._paused) return;\n this._paused = true;\n // Pause audio engine\n if (cc.audioEngine) {\n cc.audioEngine._break();\n }\n // Pause main loop\n if (this._intervalId)\n window.cancelAnimFrame(this._intervalId);\n this._intervalId = 0;\n },\n\n /**\n * !#en Resume the game from pause. This will resume:\n * game logic execution, rendering process, event manager, background music and all audio effects.\n * !#zh 恢复游戏主循环。包含:游戏逻辑,渲染,事件处理,背景音乐和所有音效。\n * @method resume\n */\n resume: function () {\n if (!this._paused) return;\n this._paused = false;\n // Resume audio engine\n if (cc.audioEngine) {\n cc.audioEngine._restore();\n }\n cc.director._resetDeltaTime();\n // Resume main loop\n this._runMainLoop();\n },\n\n /**\n * !#en Check whether the game is paused.\n * !#zh 判断游戏是否暂停。\n * @method isPaused\n * @return {Boolean}\n */\n isPaused: function () {\n return this._paused;\n },\n\n /**\n * !#en Restart game.\n * !#zh 重新开始游戏\n * @method restart\n */\n restart: function () {\n cc.director.once(cc.Director.EVENT_AFTER_DRAW, function () {\n for (var id in game._persistRootNodes) {\n game.removePersistRootNode(game._persistRootNodes[id]);\n }\n\n // Clear scene\n cc.director.getScene().destroy();\n cc.Object._deferredDestroy();\n\n // Clean up audio\n if (cc.audioEngine) {\n cc.audioEngine.uncacheAll();\n }\n\n cc.director.reset();\n\n game.pause();\n cc.assetManager.builtins.init(() => {\n game.onStart();\n game.emit(game.EVENT_RESTART);\n });\n });\n },\n\n /**\n * !#en End game, it will close the game window\n * !#zh 退出游戏\n * @method end\n */\n end: function () {\n close();\n },\n\n// @Game loading\n\n _initEngine () {\n if (this._rendererInitialized) {\n return;\n }\n\n this._initRenderer();\n\n if (!CC_EDITOR) {\n this._initEvents();\n }\n\n this.emit(this.EVENT_ENGINE_INITED);\n },\n\n _loadPreviewScript (cb) {\n if (CC_PREVIEW && window.__quick_compile_project__) {\n window.__quick_compile_project__.load(cb);\n }\n else {\n cb();\n }\n },\n\n _prepareFinished (cb) {\n // Init engine\n this._initEngine();\n this._setAnimFrame();\n cc.assetManager.builtins.init(() => {\n // Log engine version\n console.log('Cocos Creator SP v' + cc.ENGINE_VERSION);\n this._prepared = true;\n this._runMainLoop();\n\n this.emit(this.EVENT_GAME_INITED);\n\n if (cb) cb();\n });\n },\n\n eventTargetOn: EventTarget.prototype.on,\n eventTargetOnce: EventTarget.prototype.once,\n\n /**\n * !#en\n * Register an callback of a specific event type on the game object.\n * This type of event should be triggered via `emit`.\n * !#zh\n * 注册 game 的特定事件类型回调。这种类型的事件应该被 `emit` 触发。\n *\n * @method on\n * @param {String} type - A string representing the event type to listen for.\n * @param {Function} callback - The callback that will be invoked when the event is dispatched.\n * The callback is ignored if it is a duplicate (the callbacks are unique).\n * @param {any} [callback.arg1] arg1\n * @param {any} [callback.arg2] arg2\n * @param {any} [callback.arg3] arg3\n * @param {any} [callback.arg4] arg4\n * @param {any} [callback.arg5] arg5\n * @param {Object} [target] - The target (this object) to invoke the callback, can be null\n * @return {Function} - Just returns the incoming callback so you can save the anonymous function easier.\n * @typescript\n * on
\n * The target node must be placed in the root level of hierarchy, otherwise this API won't have any effect.\n * !#zh\n * 声明常驻根节点,该节点不会被在场景切换中被销毁。
\n * 目标节点必须位于为层级的根节点,否则无效。\n * @method addPersistRootNode\n * @param {Node} node - The node to be made persistent\n */\n addPersistRootNode: function (node) {\n if (!cc.Node.isNode(node) || !node.uuid) {\n cc.warnID(3800);\n return;\n }\n var id = node.uuid;\n if (!this._persistRootNodes[id]) {\n var scene = cc.director._scene;\n if (cc.isValid(scene)) {\n if (!node.parent) {\n node.parent = scene;\n }\n else if ( !(node.parent instanceof cc.Scene) ) {\n cc.warnID(3801);\n return;\n }\n else if (node.parent !== scene) {\n cc.warnID(3802);\n return;\n }\n }\n this._persistRootNodes[id] = node;\n node._persistNode = true;\n cc.assetManager._releaseManager._addPersistNodeRef(node);\n }\n },\n\n /**\n * !#en Remove a persistent root node.\n * !#zh 取消常驻根节点。\n * @method removePersistRootNode\n * @param {Node} node - The node to be removed from persistent node list\n */\n removePersistRootNode: function (node) {\n var id = node.uuid || '';\n if (node === this._persistRootNodes[id]) {\n delete this._persistRootNodes[id];\n node._persistNode = false;\n cc.assetManager._releaseManager._removePersistNodeRef(node);\n }\n },\n\n /**\n * !#en Check whether the node is a persistent root node.\n * !#zh 检查节点是否是常驻根节点。\n * @method isPersistRootNode\n * @param {Node} node - The node to be checked\n * @return {Boolean}\n */\n isPersistRootNode: function (node) {\n return node._persistNode;\n },\n\n//@Private Methods\n\n// @Time ticker section\n _setAnimFrame: function () {\n this._lastTime = performance.now();\n var frameRate = game.config.frameRate;\n this._frameTime = 1000 / frameRate;\n cc.director._maxParticleDeltaTime = this._frameTime / 1000 * 2;\n if (CC_JSB || CC_RUNTIME) {\n jsb.setPreferredFramesPerSecond(frameRate);\n window.requestAnimFrame = window.requestAnimationFrame;\n window.cancelAnimFrame = window.cancelAnimationFrame;\n }\n else {\n let rAF = window.requestAnimationFrame = window.requestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n window.oRequestAnimationFrame ||\n window.msRequestAnimationFrame;\n\n if (frameRate !== 60 && frameRate !== 30) {\n window.requestAnimFrame = rAF ? this._stTimeWithRAF : this._stTime;\n window.cancelAnimFrame = this._ctTime;\n }\n else {\n window.requestAnimFrame = rAF || this._stTime;\n\n window.cancelAnimFrame = window.cancelAnimationFrame ||\n window.cancelRequestAnimationFrame ||\n window.msCancelRequestAnimationFrame ||\n window.mozCancelRequestAnimationFrame ||\n window.oCancelRequestAnimationFrame ||\n window.webkitCancelRequestAnimationFrame ||\n window.msCancelAnimationFrame ||\n window.mozCancelAnimationFrame ||\n window.webkitCancelAnimationFrame ||\n window.oCancelAnimationFrame ||\n this._ctTime;\n }\n }\n },\n\n _stTimeWithRAF: function(callback){\n var currTime = performance.now();\n var timeToCall = Math.max(0, game._frameTime - (currTime - game._lastTime));\n var id = window.setTimeout(function() {\n window.requestAnimationFrame(callback);\n }, timeToCall);\n game._lastTime = currTime + timeToCall;\n return id;\n },\n\n _stTime: function(callback){\n var currTime = performance.now();\n var timeToCall = Math.max(0, game._frameTime - (currTime - game._lastTime));\n var id = window.setTimeout(function() { callback(); },\n timeToCall);\n game._lastTime = currTime + timeToCall;\n return id;\n },\n _ctTime: function(id){\n window.clearTimeout(id);\n },\n //Run game.\n _runMainLoop: function () {\n if (CC_EDITOR) {\n return;\n }\n if (!this._prepared) return;\n\n var self = this, callback, config = self.config,\n director = cc.director,\n skip = true, frameRate = config.frameRate;\n\n debug.setDisplayStats(config.showFPS);\n\n callback = function (now) {\n if (!self._paused) {\n self._intervalId = window.requestAnimFrame(callback);\n if (!CC_JSB && !CC_RUNTIME && frameRate === 30) {\n if (skip = !skip) {\n return;\n }\n }\n director.mainLoop(now);\n }\n };\n\n self._intervalId = window.requestAnimFrame(callback);\n self._paused = false;\n },\n\n// @Game loading section\n _initConfig (config) {\n // Configs adjustment\n if (typeof config.debugMode !== 'number') {\n config.debugMode = 0;\n }\n config.exposeClassName = !!config.exposeClassName;\n if (typeof config.frameRate !== 'number') {\n config.frameRate = 60;\n }\n let renderMode = config.renderMode;\n if (typeof renderMode !== 'number' || renderMode > 2 || renderMode < 0) {\n config.renderMode = 0;\n }\n if (typeof config.registerSystemEvent !== 'boolean') {\n config.registerSystemEvent = true;\n }\n if (renderMode === 1) {\n config.showFPS = false;\n }\n else {\n config.showFPS = !!config.showFPS;\n }\n\n // Collide Map and Group List\n this.collisionMatrix = config.collisionMatrix || [];\n this.groupList = config.groupList || [];\n\n debug._resetDebugSetting(config.debugMode);\n\n this.config = config;\n this._configLoaded = true;\n },\n\n _determineRenderType () {\n let config = this.config,\n userRenderMode = parseInt(config.renderMode) || 0;\n\n // Determine RenderType\n this.renderType = this.RENDER_TYPE_CANVAS;\n let supportRender = false;\n\n if (userRenderMode === 0) {\n if (cc.sys.capabilities['opengl']) {\n this.renderType = this.RENDER_TYPE_WEBGL;\n supportRender = true;\n }\n else if (cc.sys.capabilities['canvas']) {\n this.renderType = this.RENDER_TYPE_CANVAS;\n supportRender = true;\n }\n }\n else if (userRenderMode === 1 && cc.sys.capabilities['canvas']) {\n this.renderType = this.RENDER_TYPE_CANVAS;\n supportRender = true;\n }\n else if (userRenderMode === 2 && cc.sys.capabilities['opengl']) {\n this.renderType = this.RENDER_TYPE_WEBGL;\n supportRender = true;\n }\n\n if (!supportRender) {\n throw new Error(debug.getError(3820, userRenderMode));\n }\n },\n\n _initRenderer () {\n // Avoid setup to be called twice.\n if (this._rendererInitialized) return;\n\n let el = this.config.id,\n width, height,\n localCanvas, localContainer;\n\n if (CC_JSB || CC_RUNTIME) {\n this.container = localContainer = document.createElement(\"DIV\");\n this.frame = localContainer.parentNode === document.body ? document.documentElement : localContainer.parentNode;\n localCanvas = window.__canvas;\n this.canvas = localCanvas;\n }\n else {\n var element = (el instanceof HTMLElement) ? el : (document.querySelector(el) || document.querySelector('#' + el));\n\n if (element.tagName === \"CANVAS\") {\n width = element.width;\n height = element.height;\n\n //it is already a canvas, we wrap it around with a div\n this.canvas = localCanvas = element;\n this.container = localContainer = document.createElement(\"DIV\");\n if (localCanvas.parentNode)\n localCanvas.parentNode.insertBefore(localContainer, localCanvas);\n } else {\n //we must make a new canvas and place into this element\n if (element.tagName !== \"DIV\") {\n cc.warnID(3819);\n }\n width = element.clientWidth;\n height = element.clientHeight;\n this.canvas = localCanvas = document.createElement(\"CANVAS\");\n this.container = localContainer = document.createElement(\"DIV\");\n element.appendChild(localContainer);\n }\n localContainer.setAttribute('id', 'Cocos2dGameContainer');\n localContainer.appendChild(localCanvas);\n this.frame = (localContainer.parentNode === document.body) ? document.documentElement : localContainer.parentNode;\n\n function addClass (element, name) {\n var hasClass = (' ' + element.className + ' ').indexOf(' ' + name + ' ') > -1;\n if (!hasClass) {\n if (element.className) {\n element.className += \" \";\n }\n element.className += name;\n }\n }\n addClass(localCanvas, \"gameCanvas\");\n localCanvas.setAttribute(\"width\", width || 480);\n localCanvas.setAttribute(\"height\", height || 320);\n localCanvas.setAttribute(\"tabindex\", 99);\n }\n\n this._determineRenderType();\n // WebGL context created successfully\n if (this.renderType === this.RENDER_TYPE_WEBGL) {\n var opts = {\n 'stencil': true,\n // MSAA is causing serious performance dropdown on some browsers.\n 'antialias': cc.macro.ENABLE_WEBGL_ANTIALIAS,\n 'alpha': cc.macro.ENABLE_TRANSPARENT_CANVAS\n };\n renderer.initWebGL(localCanvas, opts);\n this._renderContext = renderer.device._gl;\n\n // Enable dynamic atlas manager by default\n if (!cc.macro.CLEANUP_IMAGE_CACHE && dynamicAtlasManager) {\n dynamicAtlasManager.enabled = true;\n }\n }\n if (!this._renderContext) {\n this.renderType = this.RENDER_TYPE_CANVAS;\n // Could be ignored by module settings\n renderer.initCanvas(localCanvas);\n this._renderContext = renderer.device._ctx;\n }\n\n this.canvas.oncontextmenu = function () {\n if (!cc._isContextMenuEnable) return false;\n };\n\n this._rendererInitialized = true;\n },\n\n _initEvents: function () {\n var win = window, hiddenPropName;\n\n // register system events\n if (this.config.registerSystemEvent)\n cc.internal.inputManager.registerSystemEvent(this.canvas);\n\n if (typeof document.hidden !== 'undefined') {\n hiddenPropName = \"hidden\";\n } else if (typeof document.mozHidden !== 'undefined') {\n hiddenPropName = \"mozHidden\";\n } else if (typeof document.msHidden !== 'undefined') {\n hiddenPropName = \"msHidden\";\n } else if (typeof document.webkitHidden !== 'undefined') {\n hiddenPropName = \"webkitHidden\";\n }\n\n var hidden = false;\n\n function onHidden () {\n if (!hidden) {\n hidden = true;\n game.emit(game.EVENT_HIDE);\n }\n }\n // In order to adapt the most of platforms the onshow API.\n function onShown (arg0, arg1, arg2, arg3, arg4) {\n if (hidden) {\n hidden = false;\n game.emit(game.EVENT_SHOW, arg0, arg1, arg2, arg3, arg4);\n }\n }\n\n if (hiddenPropName) {\n var changeList = [\n \"visibilitychange\",\n \"mozvisibilitychange\",\n \"msvisibilitychange\",\n \"webkitvisibilitychange\",\n \"qbrowserVisibilityChange\"\n ];\n for (var i = 0; i < changeList.length; i++) {\n document.addEventListener(changeList[i], function (event) {\n var visible = document[hiddenPropName];\n // QQ App\n visible = visible || event[\"hidden\"];\n if (visible)\n onHidden();\n else\n onShown();\n });\n }\n } else {\n win.addEventListener(\"blur\", onHidden);\n win.addEventListener(\"focus\", onShown);\n }\n\n if (navigator.userAgent.indexOf(\"MicroMessenger\") > -1) {\n win.onfocus = onShown;\n }\n\n if (\"onpageshow\" in window && \"onpagehide\" in window) {\n win.addEventListener(\"pagehide\", onHidden);\n win.addEventListener(\"pageshow\", onShown);\n // Taobao UIWebKit\n document.addEventListener(\"pagehide\", onHidden);\n document.addEventListener(\"pageshow\", onShown);\n }\n\n this.on(game.EVENT_HIDE, function () {\n game.pause();\n });\n this.on(game.EVENT_SHOW, function () {\n game.resume();\n });\n }\n};\n\nEventTarget.call(game);\ncc.js.addon(game, EventTarget.prototype);\n\n/**\n * @module cc\n */\n\n/**\n * !#en This is a Game instance.\n * !#zh 这是一个 Game 类的实例,包含游戏主体信息并负责驱动游戏的游戏对象。。\n * @property game\n * @type Game\n */\ncc.game = module.exports = game;\n","/****************************************************************************\n Copyright (c) 2013-2016 Chukong Technologies Inc.\n Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n'use strict';\n\nimport { Mat4, Vec2, Vec3, Quat, Trs } from './value-types';\nimport { approx } from './value-types/utils'\n\nconst BaseNode = require('./utils/base-node');\nconst PrefabHelper = require('./utils/prefab-helper');\nconst nodeMemPool = require('./utils/trans-pool').NodeMemPool;\nconst AffineTrans = require('./utils/affine-transform');\nconst eventManager = require('./event-manager');\nconst macro = require('./platform/CCMacro');\nconst js = require('./platform/js');\nconst Event = require('./event/event');\nconst EventTarget = require('./event/event-target');\nconst RenderFlow = require('./renderer/render-flow');\n\nconst Flags = cc.Object.Flags;\nconst Destroying = Flags.Destroying;\n\nconst ERR_INVALID_NUMBER = CC_EDITOR && 'The %s is invalid';\nconst ONE_DEGREE = Math.PI / 180;\n\nvar ActionManagerExist = !!cc.ActionManager;\nvar emptyFunc = function () {};\n\n// getWorldPosition temp var\nvar _gwpVec3 = new Vec3();\nvar _gwpQuat = new Quat();\n\n// _invTransformPoint temp var\nvar _tpVec3a = new Vec3();\nvar _tpVec3b = new Vec3();\nvar _tpQuata = new Quat();\nvar _tpQuatb = new Quat();\n\n// setWorldPosition temp var\nvar _swpVec3 = new Vec3();\n\n// getWorldScale temp var\nvar _gwsVec3 = new Vec3();\n\n// setWorldScale temp var\nvar _swsVec3 = new Vec3();\n\n// getWorldRT temp var\nvar _gwrtVec3a = new Vec3();\nvar _gwrtVec3b = new Vec3();\nvar _gwrtQuata = new Quat();\nvar _gwrtQuatb = new Quat();\n\n// lookAt temp var\nvar _laVec3 = new Vec3();\nvar _laQuat = new Quat();\n\n//up、right、forward temp var\nvar _urfVec3 = new Vec3();\nvar _urfQuat = new Quat();\n\n// _hitTest temp var\nvar _htVec3a = new Vec3();\nvar _htVec3b = new Vec3();\n\n// getWorldRotation temp var\nvar _gwrQuat = new Quat();\n\n// setWorldRotation temp var\nvar _swrQuat = new Quat();\n\nvar _quata = new Quat();\nvar _mat4_temp = cc.mat4();\nvar _vec3_temp = new Vec3();\n\nconst POSITION_ON = 1 << 0;\nconst SCALE_ON = 1 << 1;\nconst ROTATION_ON = 1 << 2;\nconst SIZE_ON = 1 << 3;\nconst ANCHOR_ON = 1 << 4;\nconst COLOR_ON = 1 << 5;\n\nlet _cachedPool = new js.Pool();\n_cachedPool.get = function () {\n return this._get() || [];\n};\n\nlet BuiltinGroupIndex = cc.Enum({\n DEBUG: 31\n});\n\n/**\n * !#en Node's local dirty properties flag\n * !#zh Node 的本地属性 dirty 状态位\n * @enum Node._LocalDirtyFlag\n * @static\n * @private\n * @namespace Node\n */\nvar LocalDirtyFlag = cc.Enum({\n /**\n * !#en Flag for position dirty\n * !#zh 位置 dirty 的标记位\n * @property {Number} POSITION\n * @static\n */\n POSITION: 1 << 0,\n /**\n * !#en Flag for scale dirty\n * !#zh 缩放 dirty 的标记位\n * @property {Number} SCALE\n * @static\n */\n SCALE: 1 << 1,\n /**\n * !#en Flag for rotation dirty\n * !#zh 旋转 dirty 的标记位\n * @property {Number} ROTATION\n * @static\n */\n ROTATION: 1 << 2,\n /**\n * !#en Flag for skew dirty\n * !#zh skew dirty 的标记位\n * @property {Number} SKEW\n * @static\n */\n SKEW: 1 << 3,\n /**\n * !#en Flag for rotation, scale or position dirty\n * !#zh 旋转,缩放,或位置 dirty 的标记位\n * @property {Number} TRS\n * @static\n */\n TRS: 1 << 0 | 1 << 1 | 1 << 2,\n /**\n * !#en Flag for rotation or scale dirty\n * !#zh 旋转或缩放 dirty 的标记位\n * @property {Number} RS\n * @static\n */\n RS: 1 << 1 | 1 << 2,\n /**\n * !#en Flag for rotation, scale, position, skew dirty\n * !#zh 旋转,缩放,位置,或斜角 dirty 的标记位\n * @property {Number} TRS\n * @static\n */\n TRSS: 1 << 0 | 1 << 1 | 1 << 2 | 1 << 3,\n\n /**\n * !#en Flag for physics position dirty\n * !#zh 物理位置 dirty 的标记位\n * @property {Number} PHYSICS_POSITION\n * @static\n */\n PHYSICS_POSITION: 1 << 4,\n\n /**\n * !#en Flag for physics scale dirty\n * !#zh 物理缩放 dirty 的标记位\n * @property {Number} PHYSICS_SCALE\n * @static\n */\n PHYSICS_SCALE: 1 << 5,\n\n /**\n * !#en Flag for physics rotation dirty\n * !#zh 物理旋转 dirty 的标记位\n * @property {Number} PHYSICS_ROTATION\n * @static\n */\n PHYSICS_ROTATION: 1 << 6,\n\n /**\n * !#en Flag for physics trs dirty\n * !#zh 物理位置旋转缩放 dirty 的标记位\n * @property {Number} PHYSICS_TRS\n * @static\n */\n PHYSICS_TRS: 1 << 4 | 1 << 5 | 1 << 6,\n\n /**\n * !#en Flag for physics rs dirty\n * !#zh 物理旋转缩放 dirty 的标记位\n * @property {Number} PHYSICS_RS\n * @static\n */\n PHYSICS_RS: 1 << 5 | 1 << 6,\n\n /**\n * !#en Flag for node and physics position dirty\n * !#zh 所有位置 dirty 的标记位\n * @property {Number} ALL_POSITION\n * @static\n */\n ALL_POSITION: 1 << 0 | 1 << 4,\n\n /**\n * !#en Flag for node and physics scale dirty\n * !#zh 所有缩放 dirty 的标记位\n * @property {Number} ALL_SCALE\n * @static\n */\n ALL_SCALE: 1 << 1 | 1 << 5,\n\n /**\n * !#en Flag for node and physics rotation dirty\n * !#zh 所有旋转 dirty 的标记位\n * @property {Number} ALL_ROTATION\n * @static\n */\n ALL_ROTATION: 1 << 2 | 1 << 6,\n\n /**\n * !#en Flag for node and physics trs dirty\n * !#zh 所有trs dirty 的标记位\n * @property {Number} ALL_TRS\n * @static\n */\n ALL_TRS: 1 << 0 | 1 << 1 | 1 << 2 | 1 << 4 | 1 << 5 | 1 << 6,\n\n /**\n * !#en Flag for all dirty properties\n * !#zh 覆盖所有 dirty 状态的标记位\n * @property {Number} ALL\n * @static\n */\n ALL: 0xffff,\n});\n\n/**\n * !#en The event type supported by Node\n * !#zh Node 支持的事件类型\n * @class Node.EventType\n * @static\n * @namespace Node\n */\n// Why EventType defined as class, because the first parameter of Node.on method needs set as 'string' type.\nvar EventType = cc.Enum({\n /**\n * !#en The event type for touch start event, you can use its value directly: 'touchstart'\n * !#zh 当手指触摸到屏幕时。\n * @property {String} TOUCH_START\n * @static\n */\n TOUCH_START: 'touchstart',\n /**\n * !#en The event type for touch move event, you can use its value directly: 'touchmove'\n * !#zh 当手指在屏幕上移动时。\n * @property {String} TOUCH_MOVE\n * @static\n */\n TOUCH_MOVE: 'touchmove',\n /**\n * !#en The event type for touch end event, you can use its value directly: 'touchend'\n * !#zh 当手指在目标节点区域内离开屏幕时。\n * @property {String} TOUCH_END\n * @static\n */\n TOUCH_END: 'touchend',\n /**\n * !#en The event type for touch end event, you can use its value directly: 'touchcancel'\n * !#zh 当手指在目标节点区域外离开屏幕时。\n * @property {String} TOUCH_CANCEL\n * @static\n */\n TOUCH_CANCEL: 'touchcancel',\n\n /**\n * !#en The event type for mouse down events, you can use its value directly: 'mousedown'\n * !#zh 当鼠标按下时触发一次。\n * @property {String} MOUSE_DOWN\n * @static\n */\n MOUSE_DOWN: 'mousedown',\n /**\n * !#en The event type for mouse move events, you can use its value directly: 'mousemove'\n * !#zh 当鼠标在目标节点在目标节点区域中移动时,不论是否按下。\n * @property {String} MOUSE_MOVE\n * @static\n */\n MOUSE_MOVE: 'mousemove',\n /**\n * !#en The event type for mouse enter target events, you can use its value directly: 'mouseenter'\n * !#zh 当鼠标移入目标节点区域时,不论是否按下。\n * @property {String} MOUSE_ENTER\n * @static\n */\n MOUSE_ENTER: 'mouseenter',\n /**\n * !#en The event type for mouse leave target events, you can use its value directly: 'mouseleave'\n * !#zh 当鼠标移出目标节点区域时,不论是否按下。\n * @property {String} MOUSE_LEAVE\n * @static\n */\n MOUSE_LEAVE: 'mouseleave',\n /**\n * !#en The event type for mouse up events, you can use its value directly: 'mouseup'\n * !#zh 当鼠标从按下状态松开时触发一次。\n * @property {String} MOUSE_UP\n * @static\n */\n MOUSE_UP: 'mouseup',\n /**\n * !#en The event type for mouse wheel events, you can use its value directly: 'mousewheel'\n * !#zh 当鼠标滚轮滚动时。\n * @property {String} MOUSE_WHEEL\n * @static\n */\n MOUSE_WHEEL: 'mousewheel',\n\n /**\n * !#en The event type for position change events.\n * Performance note, this event will be triggered every time corresponding properties being changed,\n * if the event callback have heavy logic it may have great performance impact, try to avoid such scenario.\n * !#zh 当节点位置改变时触发的事件。\n * 性能警告:这个事件会在每次对应的属性被修改时触发,如果事件回调损耗较高,有可能对性能有很大的负面影响,请尽量避免这种情况。\n * @property {String} POSITION_CHANGED\n * @static\n */\n POSITION_CHANGED: 'position-changed',\n /**\n * !#en The event type for rotation change events.\n * Performance note, this event will be triggered every time corresponding properties being changed,\n * if the event callback have heavy logic it may have great performance impact, try to avoid such scenario.\n * !#zh 当节点旋转改变时触发的事件。\n * 性能警告:这个事件会在每次对应的属性被修改时触发,如果事件回调损耗较高,有可能对性能有很大的负面影响,请尽量避免这种情况。\n * @property {String} ROTATION_CHANGED\n * @static\n */\n ROTATION_CHANGED: 'rotation-changed',\n /**\n * !#en The event type for scale change events.\n * Performance note, this event will be triggered every time corresponding properties being changed,\n * if the event callback have heavy logic it may have great performance impact, try to avoid such scenario.\n * !#zh 当节点缩放改变时触发的事件。\n * 性能警告:这个事件会在每次对应的属性被修改时触发,如果事件回调损耗较高,有可能对性能有很大的负面影响,请尽量避免这种情况。\n * @property {String} SCALE_CHANGED\n * @static\n */\n SCALE_CHANGED: 'scale-changed',\n /**\n * !#en The event type for size change events.\n * Performance note, this event will be triggered every time corresponding properties being changed,\n * if the event callback have heavy logic it may have great performance impact, try to avoid such scenario.\n * !#zh 当节点尺寸改变时触发的事件。\n * 性能警告:这个事件会在每次对应的属性被修改时触发,如果事件回调损耗较高,有可能对性能有很大的负面影响,请尽量避免这种情况。\n * @property {String} SIZE_CHANGED\n * @static\n */\n SIZE_CHANGED: 'size-changed',\n /**\n * !#en The event type for anchor point change events.\n * Performance note, this event will be triggered every time corresponding properties being changed,\n * if the event callback have heavy logic it may have great performance impact, try to avoid such scenario.\n * !#zh 当节点锚点改变时触发的事件。\n * 性能警告:这个事件会在每次对应的属性被修改时触发,如果事件回调损耗较高,有可能对性能有很大的负面影响,请尽量避免这种情况。\n * @property {String} ANCHOR_CHANGED\n * @static\n */\n ANCHOR_CHANGED: 'anchor-changed',\n /**\n * !#en The event type for color change events.\n * Performance note, this event will be triggered every time corresponding properties being changed,\n * if the event callback have heavy logic it may have great performance impact, try to avoid such scenario.\n * !#zh 当节点颜色改变时触发的事件。\n * 性能警告:这个事件会在每次对应的属性被修改时触发,如果事件回调损耗较高,有可能对性能有很大的负面影响,请尽量避免这种情况。\n * @property {String} COLOR_CHANGED\n * @static\n */\n COLOR_CHANGED: 'color-changed',\n /**\n * !#en The event type for new child added events.\n * !#zh 当新的子节点被添加时触发的事件。\n * @property {String} CHILD_ADDED\n * @static\n */\n CHILD_ADDED: 'child-added',\n /**\n * !#en The event type for child removed events.\n * !#zh 当子节点被移除时触发的事件。\n * @property {String} CHILD_REMOVED\n * @static\n */\n CHILD_REMOVED: 'child-removed',\n /**\n * !#en The event type for children reorder events.\n * !#zh 当子节点顺序改变时触发的事件。\n * @property {String} CHILD_REORDER\n * @static\n */\n CHILD_REORDER: 'child-reorder',\n /**\n * !#en The event type for node group changed events.\n * !#zh 当节点归属群组发生变化时触发的事件。\n * @property {String} GROUP_CHANGED\n * @static\n */\n GROUP_CHANGED: 'group-changed',\n /**\n * !#en The event type for node's sibling order changed.\n * !#zh 当节点在兄弟节点中的顺序发生变化时触发的事件。\n * @property {String} SIBLING_ORDER_CHANGED\n * @static\n */\n SIBLING_ORDER_CHANGED: 'sibling-order-changed',\n});\n\nvar _touchEvents = [\n EventType.TOUCH_START,\n EventType.TOUCH_MOVE,\n EventType.TOUCH_END,\n EventType.TOUCH_CANCEL,\n];\nvar _mouseEvents = [\n EventType.MOUSE_DOWN,\n EventType.MOUSE_ENTER,\n EventType.MOUSE_MOVE,\n EventType.MOUSE_LEAVE,\n EventType.MOUSE_UP,\n EventType.MOUSE_WHEEL,\n];\n\nvar _skewNeedWarn = true;\nvar _skewWarn = function (value, node) {\n if (value !== 0) {\n var nodePath = \"\";\n if (CC_EDITOR) {\n var NodeUtils = Editor.require('scene://utils/node');\n nodePath = `Node: ${NodeUtils.getNodePath(node)}.`\n }\n _skewNeedWarn && cc.warn(\"`cc.Node.skewX/Y` is deprecated since v2.2.1, please use 3D node instead.\", nodePath);\n !CC_EDITOR && (_skewNeedWarn = false);\n }\n}\n\nvar _currentHovered = null;\n\nvar _touchStartHandler = function (touch, event) {\n var pos = touch.getLocation();\n var node = this.owner;\n\n if (node._hitTest(pos, this)) {\n event.type = EventType.TOUCH_START;\n event.touch = touch;\n event.bubbles = true;\n node.dispatchEvent(event);\n return true;\n }\n return false;\n};\nvar _touchMoveHandler = function (touch, event) {\n var node = this.owner;\n event.type = EventType.TOUCH_MOVE;\n event.touch = touch;\n event.bubbles = true;\n node.dispatchEvent(event);\n};\nvar _touchEndHandler = function (touch, event) {\n var pos = touch.getLocation();\n var node = this.owner;\n\n if (node._hitTest(pos, this)) {\n event.type = EventType.TOUCH_END;\n }\n else {\n event.type = EventType.TOUCH_CANCEL;\n }\n event.touch = touch;\n event.bubbles = true;\n node.dispatchEvent(event);\n};\nvar _touchCancelHandler = function (touch, event) {\n var pos = touch.getLocation();\n var node = this.owner;\n\n event.type = EventType.TOUCH_CANCEL;\n event.touch = touch;\n event.bubbles = true;\n node.dispatchEvent(event);\n};\n\nvar _mouseDownHandler = function (event) {\n var pos = event.getLocation();\n var node = this.owner;\n\n if (node._hitTest(pos, this)) {\n event.type = EventType.MOUSE_DOWN;\n event.bubbles = true;\n node.dispatchEvent(event);\n }\n};\nvar _mouseMoveHandler = function (event) {\n var pos = event.getLocation();\n var node = this.owner;\n var hit = node._hitTest(pos, this);\n if (hit) {\n if (!this._previousIn) {\n // Fix issue when hover node switched, previous hovered node won't get MOUSE_LEAVE notification\n if (_currentHovered && _currentHovered._mouseListener) {\n event.type = EventType.MOUSE_LEAVE;\n _currentHovered.dispatchEvent(event);\n _currentHovered._mouseListener._previousIn = false;\n }\n _currentHovered = this.owner;\n event.type = EventType.MOUSE_ENTER;\n node.dispatchEvent(event);\n this._previousIn = true;\n }\n event.type = EventType.MOUSE_MOVE;\n event.bubbles = true;\n node.dispatchEvent(event);\n }\n else if (this._previousIn) {\n event.type = EventType.MOUSE_LEAVE;\n node.dispatchEvent(event);\n this._previousIn = false;\n _currentHovered = null;\n }\n else {\n // continue dispatching\n return;\n }\n\n // Event processed, cleanup\n event.stopPropagation();\n};\nvar _mouseUpHandler = function (event) {\n var pos = event.getLocation();\n var node = this.owner;\n\n if (node._hitTest(pos, this)) {\n event.type = EventType.MOUSE_UP;\n event.bubbles = true;\n node.dispatchEvent(event);\n event.stopPropagation();\n }\n};\nvar _mouseWheelHandler = function (event) {\n var pos = event.getLocation();\n var node = this.owner;\n\n if (node._hitTest(pos, this)) {\n event.type = EventType.MOUSE_WHEEL;\n event.bubbles = true;\n node.dispatchEvent(event);\n event.stopPropagation();\n }\n};\n\nfunction _searchComponentsInParent (node, comp) {\n if (comp) {\n let index = 0;\n let list = null;\n for (var curr = node; curr && cc.Node.isNode(curr); curr = curr._parent, ++index) {\n if (curr.getComponent(comp)) {\n let next = {\n index: index,\n node: curr,\n };\n\n if (list) {\n list.push(next);\n } else {\n list = [next];\n }\n }\n }\n\n return list;\n }\n\n return null;\n}\n\nfunction _checkListeners (node, events) {\n if (!(node._objFlags & Destroying)) {\n if (node._bubblingListeners) {\n for (let i = 0, l = events.length; i < l; ++i) {\n if (node._bubblingListeners.hasEventListener(events[i])) {\n return true;\n }\n }\n }\n if (node._capturingListeners) {\n for (let i = 0, l = events.length; i < l; ++i) {\n if (node._capturingListeners.hasEventListener(events[i])) {\n return true;\n }\n }\n }\n return false;\n }\n return true;\n}\n\nfunction _doDispatchEvent (owner, event, cachedArray) {\n var target, i;\n event.target = owner;\n\n // Event.CAPTURING_PHASE\n cachedArray.length = 0;\n owner._getCapturingTargets(event.type, cachedArray);\n // capturing\n event.eventPhase = 1;\n for (i = cachedArray.length - 1; i >= 0; --i) {\n target = cachedArray[i];\n if (target._capturingListeners) {\n event.currentTarget = target;\n // fire event\n target._capturingListeners.emit(event.type, event, cachedArray);\n // check if propagation stopped\n if (event._propagationStopped) {\n cachedArray.length = 0;\n return;\n }\n }\n }\n cachedArray.length = 0;\n\n // Event.AT_TARGET\n // checks if destroyed in capturing callbacks\n event.eventPhase = 2;\n event.currentTarget = owner;\n if (owner._capturingListeners) {\n owner._capturingListeners.emit(event.type, event);\n }\n if (!event._propagationImmediateStopped && owner._bubblingListeners) {\n owner._bubblingListeners.emit(event.type, event);\n }\n\n if (!event._propagationStopped && event.bubbles) {\n // Event.BUBBLING_PHASE\n owner._getBubblingTargets(event.type, cachedArray);\n // propagate\n event.eventPhase = 3;\n for (i = 0; i < cachedArray.length; ++i) {\n target = cachedArray[i];\n if (target._bubblingListeners) {\n event.currentTarget = target;\n // fire event\n target._bubblingListeners.emit(event.type, event);\n // check if propagation stopped\n if (event._propagationStopped) {\n cachedArray.length = 0;\n return;\n }\n }\n }\n }\n cachedArray.length = 0;\n}\n\n// traversal the node tree, child cullingMask must keep the same with the parent.\nfunction _getActualGroupIndex (node) {\n let groupIndex = node.groupIndex;\n if (groupIndex === 0 && node.parent) {\n groupIndex = _getActualGroupIndex(node.parent);\n }\n return groupIndex;\n}\n\nfunction _updateCullingMask (node) {\n let index = _getActualGroupIndex(node);\n node._cullingMask = 1 << index;\n if (CC_JSB && CC_NATIVERENDERER) {\n node._proxy && node._proxy.updateCullingMask();\n }\n for (let i = 0; i < node._children.length; i++) {\n _updateCullingMask(node._children[i]);\n }\n}\n\n// 2D/3D matrix functions\nfunction updateLocalMatrix3D () {\n if (this._localMatDirty & LocalDirtyFlag.TRSS) {\n // Update transform\n let t = this._matrix;\n let tm = t.m;\n Trs.toMat4(t, this._trs);\n\n // skew\n if (this._skewX || this._skewY) {\n let a = tm[0], b = tm[1], c = tm[4], d = tm[5];\n let skx = Math.tan(this._skewX * ONE_DEGREE);\n let sky = Math.tan(this._skewY * ONE_DEGREE);\n if (skx === Infinity)\n skx = 99999999;\n if (sky === Infinity)\n sky = 99999999;\n tm[0] = a + c * sky;\n tm[1] = b + d * sky;\n tm[4] = c + a * skx;\n tm[5] = d + b * skx;\n }\n this._localMatDirty &= ~LocalDirtyFlag.TRSS;\n // Register dirty status of world matrix so that it can be recalculated\n this._worldMatDirty = true;\n }\n}\n\nfunction updateLocalMatrix2D () {\n let dirtyFlag = this._localMatDirty;\n if (!(dirtyFlag & LocalDirtyFlag.TRSS)) return;\n\n // Update transform\n let t = this._matrix;\n let tm = t.m;\n let trs = this._trs;\n\n if (dirtyFlag & (LocalDirtyFlag.RS | LocalDirtyFlag.SKEW)) {\n let rotation = -this._eulerAngles.z;\n let hasSkew = this._skewX || this._skewY;\n let sx = trs[7], sy = trs[8];\n\n if (rotation || hasSkew) {\n let a = 1, b = 0, c = 0, d = 1;\n // rotation\n if (rotation) {\n let rotationRadians = rotation * ONE_DEGREE;\n c = Math.sin(rotationRadians);\n d = Math.cos(rotationRadians);\n a = d;\n b = -c;\n }\n // scale\n tm[0] = a *= sx;\n tm[1] = b *= sx;\n tm[4] = c *= sy;\n tm[5] = d *= sy;\n // skew\n if (hasSkew) {\n let a = tm[0], b = tm[1], c = tm[4], d = tm[5];\n let skx = Math.tan(this._skewX * ONE_DEGREE);\n let sky = Math.tan(this._skewY * ONE_DEGREE);\n if (skx === Infinity)\n skx = 99999999;\n if (sky === Infinity)\n sky = 99999999;\n tm[0] = a + c * sky;\n tm[1] = b + d * sky;\n tm[4] = c + a * skx;\n tm[5] = d + b * skx;\n }\n }\n else {\n tm[0] = sx;\n tm[1] = 0;\n tm[4] = 0;\n tm[5] = sy;\n }\n }\n\n // position\n tm[12] = trs[0];\n tm[13] = trs[1];\n\n this._localMatDirty &= ~LocalDirtyFlag.TRSS;\n // Register dirty status of world matrix so that it can be recalculated\n this._worldMatDirty = true;\n}\n\nfunction calculWorldMatrix3D () {\n // Avoid as much function call as possible\n if (this._localMatDirty & LocalDirtyFlag.TRSS) {\n this._updateLocalMatrix();\n }\n\n if (this._parent) {\n let parentMat = this._parent._worldMatrix;\n Mat4.mul(this._worldMatrix, parentMat, this._matrix);\n }\n else {\n Mat4.copy(this._worldMatrix, this._matrix);\n }\n this._worldMatDirty = false;\n}\n\nfunction calculWorldMatrix2D () {\n // Avoid as much function call as possible\n if (this._localMatDirty & LocalDirtyFlag.TRSS) {\n this._updateLocalMatrix();\n }\n\n // Assume parent world matrix is correct\n let parent = this._parent;\n if (parent) {\n this._mulMat(this._worldMatrix, parent._worldMatrix, this._matrix);\n }\n else {\n Mat4.copy(this._worldMatrix, this._matrix);\n }\n this._worldMatDirty = false;\n}\n\nfunction mulMat2D (out, a, b) {\n let am = a.m, bm = b.m, outm = out.m;\n let aa=am[0], ab=am[1], ac=am[4], ad=am[5], atx=am[12], aty=am[13];\n let ba=bm[0], bb=bm[1], bc=bm[4], bd=bm[5], btx=bm[12], bty=bm[13];\n if (ab !== 0 || ac !== 0) {\n outm[0] = ba * aa + bb * ac;\n outm[1] = ba * ab + bb * ad;\n outm[4] = bc * aa + bd * ac;\n outm[5] = bc * ab + bd * ad;\n outm[12] = aa * btx + ac * bty + atx;\n outm[13] = ab * btx + ad * bty + aty;\n }\n else {\n outm[0] = ba * aa;\n outm[1] = bb * ad;\n outm[4] = bc * aa;\n outm[5] = bd * ad;\n outm[12] = aa * btx + atx;\n outm[13] = ad * bty + aty;\n }\n}\n\nconst mulMat3D = Mat4.mul;\n\n/**\n * !#en\n * Class of all entities in Cocos Creator scenes.
\n * For events supported by Node, please refer to {{#crossLink \"Node.EventType\"}}{{/crossLink}}\n * !#zh\n * Cocos Creator 场景中的所有节点类。
\n * 支持的节点事件,请参阅 {{#crossLink \"Node.EventType\"}}{{/crossLink}}。\n * @class Node\n * @extends _BaseNode\n */\nlet NodeDefines = {\n name: 'cc.Node',\n extends: BaseNode,\n\n properties: {\n // SERIALIZABLE\n _opacity: 255,\n _color: cc.Color.WHITE,\n _contentSize: cc.Size,\n _anchorPoint: cc.v2(0.5, 0.5),\n _position: undefined,\n _scale: undefined,\n _trs: null,\n _eulerAngles: cc.Vec3,\n _skewX: 0.0,\n _skewY: 0.0,\n _zIndex: {\n default: undefined,\n type: cc.Integer\n },\n _localZOrder: {\n default: 0,\n serializable: false\n },\n\n _is3DNode: false,\n\n // internal properties\n /**\n * !#en\n * Group index of node.
\n * Which Group this node belongs to will resolve that this node's collision components can collide with which other collision componentns.
\n * !#zh\n * 节点的分组索引。
\n * 节点的分组将关系到节点的碰撞组件可以与哪些碰撞组件相碰撞。
\n * @property groupIndex\n * @type {Integer}\n * @default 0\n */\n _groupIndex: {\n default: 0,\n formerlySerializedAs: 'groupIndex'\n },\n groupIndex: {\n get () {\n return this._groupIndex;\n },\n set (value) {\n this._groupIndex = value;\n _updateCullingMask(this);\n this.emit(EventType.GROUP_CHANGED, this);\n }\n },\n\n /**\n * !#en\n * Group of node.
\n * Which Group this node belongs to will resolve that this node's collision components can collide with which other collision componentns.
\n * !#zh\n * 节点的分组。
\n * 节点的分组将关系到节点的碰撞组件可以与哪些碰撞组件相碰撞。
\n * @property group\n * @type {String}\n */\n group: {\n get () {\n return cc.game.groupList[this.groupIndex] || '';\n },\n\n set (value) {\n // update the groupIndex\n this.groupIndex = cc.game.groupList.indexOf(value);\n }\n },\n\n //properties moved from base node begin\n\n /**\n * !#en The position (x, y) of the node in its parent's coordinates.\n * !#zh 节点在父节点坐标系中的位置(x, y)。\n * @property {Vec3} position\n * @example\n * cc.log(\"Node Position: \" + node.position);\n */\n\n /**\n * !#en x axis position of node.\n * !#zh 节点 X 轴坐标。\n * @property x\n * @type {Number}\n * @example\n * node.x = 100;\n * cc.log(\"Node Position X: \" + node.x);\n */\n x: {\n get () {\n return this._trs[0];\n },\n set (value) {\n let trs = this._trs;\n if (value !== trs[0]) {\n if (!CC_EDITOR || isFinite(value)) {\n let oldValue;\n if (CC_EDITOR) {\n oldValue = trs[0];\n }\n\n trs[0] = value;\n this.setLocalDirty(LocalDirtyFlag.ALL_POSITION);\n\n // fast check event\n if (this._eventMask & POSITION_ON) {\n // send event\n if (CC_EDITOR) {\n this.emit(EventType.POSITION_CHANGED, new cc.Vec3(oldValue, trs[1], trs[2]));\n }\n else {\n this.emit(EventType.POSITION_CHANGED);\n }\n }\n }\n else {\n cc.error(ERR_INVALID_NUMBER, 'new x');\n }\n }\n },\n },\n\n /**\n * !#en y axis position of node.\n * !#zh 节点 Y 轴坐标。\n * @property y\n * @type {Number}\n * @example\n * node.y = 100;\n * cc.log(\"Node Position Y: \" + node.y);\n */\n y: {\n get () {\n return this._trs[1];\n },\n set (value) {\n let trs = this._trs;\n if (value !== trs[1]) {\n if (!CC_EDITOR || isFinite(value)) {\n let oldValue;\n if (CC_EDITOR) {\n oldValue = trs[1];\n }\n\n trs[1] = value;\n this.setLocalDirty(LocalDirtyFlag.ALL_POSITION);\n\n // fast check event\n if (this._eventMask & POSITION_ON) {\n // send event\n if (CC_EDITOR) {\n this.emit(EventType.POSITION_CHANGED, new cc.Vec3(trs[0], oldValue, trs[2]));\n }\n else {\n this.emit(EventType.POSITION_CHANGED);\n }\n }\n }\n else {\n cc.error(ERR_INVALID_NUMBER, 'new y');\n }\n }\n },\n },\n\n /**\n * !#en z axis position of node.\n * !#zh 节点 Z 轴坐标。\n * @property z\n * @type {Number}\n */\n z: {\n get () {\n return this._trs[2];\n },\n set (value) {\n let trs = this._trs;\n if (value !== trs[2]) {\n if (!CC_EDITOR || isFinite(value)) {\n let oldValue;\n if (CC_EDITOR) {\n oldValue = trs[2];\n }\n trs[2] = value;\n this.setLocalDirty(LocalDirtyFlag.ALL_POSITION);\n !CC_NATIVERENDERER && (this._renderFlag |= RenderFlow.FLAG_WORLD_TRANSFORM);\n // fast check event\n if (this._eventMask & POSITION_ON) {\n if (CC_EDITOR) {\n this.emit(EventType.POSITION_CHANGED, new cc.Vec3(trs[0], trs[1], oldValue));\n }\n else {\n this.emit(EventType.POSITION_CHANGED);\n }\n }\n }\n else {\n cc.error(ERR_INVALID_NUMBER, 'new z');\n }\n }\n }\n },\n\n /**\n * !#en Rotation of node.\n * !#zh 该节点旋转角度。\n * @property rotation\n * @type {Number}\n * @deprecated since v2.1\n * @example\n * node.rotation = 90;\n * cc.log(\"Node Rotation: \" + node.rotation);\n */\n rotation: {\n get () {\n if (CC_DEBUG) {\n cc.warn(\"`cc.Node.rotation` is deprecated since v2.1.0, please use `-angle` instead. (`this.node.rotation` -> `-this.node.angle`)\");\n }\n return -this.angle;\n },\n set (value) {\n if (CC_DEBUG) {\n cc.warn(\"`cc.Node.rotation` is deprecated since v2.1.0, please set `-angle` instead. (`this.node.rotation = x` -> `this.node.angle = -x`)\");\n }\n this.angle = -value;\n }\n },\n\n /**\n * !#en\n * Angle of node, the positive value is anti-clockwise direction.\n * !#zh\n * 该节点的旋转角度,正值为逆时针方向。\n * @property angle\n * @type {Number}\n */\n angle: {\n get () {\n return this._eulerAngles.z;\n },\n set (value) {\n Vec3.set(this._eulerAngles, 0, 0, value);\n Trs.fromAngleZ(this._trs, value);\n this.setLocalDirty(LocalDirtyFlag.ALL_ROTATION);\n\n if (this._eventMask & ROTATION_ON) {\n this.emit(EventType.ROTATION_CHANGED);\n }\n }\n },\n\n /**\n * !#en The rotation as Euler angles in degrees, used in 3D node.\n * !#zh 该节点的欧拉角度,用于 3D 节点。\n * @property eulerAngles\n * @type {Vec3}\n * @example\n * node.is3DNode = true;\n * node.eulerAngles = cc.v3(45, 45, 45);\n * cc.log(\"Node eulerAngles (X, Y, Z): \" + node.eulerAngles.toString());\n */\n\n /**\n * !#en Rotation on x axis.\n * !#zh 该节点 X 轴旋转角度。\n * @property rotationX\n * @type {Number}\n * @deprecated since v2.1\n * @example\n * node.is3DNode = true;\n * node.eulerAngles = cc.v3(45, 0, 0);\n * cc.log(\"Node eulerAngles X: \" + node.eulerAngles.x);\n */\n rotationX: {\n get () {\n if (CC_DEBUG) {\n cc.warn(\"`cc.Node.rotationX` is deprecated since v2.1.0, please use `eulerAngles.x` instead. (`this.node.rotationX` -> `this.node.eulerAngles.x`)\");\n }\n return this._eulerAngles.x;\n },\n set (value) {\n if (CC_DEBUG) {\n cc.warn(\"`cc.Node.rotationX` is deprecated since v2.1.0, please set `eulerAngles` instead. (`this.node.rotationX = x` -> `this.node.is3DNode = true; this.node.eulerAngles = cc.v3(x, 0, 0)`\");\n }\n if (this._eulerAngles.x !== value) {\n this._eulerAngles.x = value;\n // Update quaternion from rotation\n if (this._eulerAngles.x === this._eulerAngles.y) {\n Trs.fromAngleZ(this._trs, -value);\n }\n else {\n Trs.fromEulerNumber(this._trs, value, this._eulerAngles.y, 0);\n }\n this.setLocalDirty(LocalDirtyFlag.ALL_ROTATION);\n\n if (this._eventMask & ROTATION_ON) {\n this.emit(EventType.ROTATION_CHANGED);\n }\n }\n },\n },\n\n /**\n * !#en Rotation on y axis.\n * !#zh 该节点 Y 轴旋转角度。\n * @property rotationY\n * @type {Number}\n * @deprecated since v2.1\n * @example\n * node.is3DNode = true;\n * node.eulerAngles = cc.v3(0, 45, 0);\n * cc.log(\"Node eulerAngles Y: \" + node.eulerAngles.y);\n */\n rotationY: {\n get () {\n if (CC_DEBUG) {\n cc.warn(\"`cc.Node.rotationY` is deprecated since v2.1.0, please use `eulerAngles.y` instead. (`this.node.rotationY` -> `this.node.eulerAngles.y`)\");\n }\n return this._eulerAngles.y;\n },\n set (value) {\n if (CC_DEBUG) {\n cc.warn(\"`cc.Node.rotationY` is deprecated since v2.1.0, please set `eulerAngles` instead. (`this.node.rotationY = y` -> `this.node.is3DNode = true; this.node.eulerAngles = cc.v3(0, y, 0)`\");\n }\n if (this._eulerAngles.y !== value) {\n this._eulerAngles.y = value;\n // Update quaternion from rotation\n if (this._eulerAngles.x === this._eulerAngles.y) {\n Trs.fromAngleZ(this._trs, -value);\n }\n else {\n Trs.fromEulerNumber(this._trs, this._eulerAngles.x, value, 0);\n }\n this.setLocalDirty(LocalDirtyFlag.ALL_ROTATION);\n\n if (this._eventMask & ROTATION_ON) {\n this.emit(EventType.ROTATION_CHANGED);\n }\n }\n },\n },\n\n eulerAngles: {\n get () {\n if (CC_EDITOR) {\n return this._eulerAngles;\n }\n else {\n return Trs.toEuler(this._eulerAngles, this._trs);\n }\n }, set (v) {\n if (CC_EDITOR) {\n this._eulerAngles.set(v);\n }\n\n Trs.fromEuler(this._trs, v);\n this.setLocalDirty(LocalDirtyFlag.ALL_ROTATION);\n !CC_NATIVERENDERER && (this._renderFlag |= RenderFlow.FLAG_TRANSFORM);\n\n if (this._eventMask & ROTATION_ON) {\n this.emit(EventType.ROTATION_CHANGED);\n }\n }\n },\n\n // This property is used for Mesh Skeleton Animation\n // Should be removed when node.rotation upgrade to quaternion value\n quat: {\n get () {\n let trs = this._trs;\n return new Quat(trs[3], trs[4], trs[5], trs[6]);\n }, set (v) {\n this.setRotation(v);\n }\n },\n\n /**\n * !#en The local scale relative to the parent.\n * !#zh 节点相对父节点的缩放。\n * @property scale\n * @type {Number}\n * @example\n * node.scale = 1;\n */\n scale: {\n get () {\n return this._trs[7];\n },\n set (v) {\n this.setScale(v);\n }\n },\n\n /**\n * !#en Scale on x axis.\n * !#zh 节点 X 轴缩放。\n * @property scaleX\n * @type {Number}\n * @example\n * node.scaleX = 0.5;\n * cc.log(\"Node Scale X: \" + node.scaleX);\n */\n scaleX: {\n get () {\n return this._trs[7];\n },\n set (value) {\n if (this._trs[7] !== value) {\n this._trs[7] = value;\n this.setLocalDirty(LocalDirtyFlag.ALL_SCALE);\n\n if (this._eventMask & SCALE_ON) {\n this.emit(EventType.SCALE_CHANGED);\n }\n }\n },\n },\n\n /**\n * !#en Scale on y axis.\n * !#zh 节点 Y 轴缩放。\n * @property scaleY\n * @type {Number}\n * @example\n * node.scaleY = 0.5;\n * cc.log(\"Node Scale Y: \" + node.scaleY);\n */\n scaleY: {\n get () {\n return this._trs[8];\n },\n set (value) {\n if (this._trs[8] !== value) {\n this._trs[8] = value;\n this.setLocalDirty(LocalDirtyFlag.ALL_SCALE);\n\n if (this._eventMask & SCALE_ON) {\n this.emit(EventType.SCALE_CHANGED);\n }\n }\n },\n },\n\n /**\n * !#en Scale on z axis.\n * !#zh 节点 Z 轴缩放。\n * @property scaleZ\n * @type {Number}\n */\n scaleZ: {\n get () {\n return this._trs[9];\n },\n set (value) {\n if (this._trs[9] !== value) {\n this._trs[9] = value;\n this.setLocalDirty(LocalDirtyFlag.ALL_SCALE);\n !CC_NATIVERENDERER && (this._renderFlag |= RenderFlow.FLAG_TRANSFORM);\n\n if (this._eventMask & SCALE_ON) {\n this.emit(EventType.SCALE_CHANGED);\n }\n }\n }\n },\n\n /**\n * !#en Skew x\n * !#zh 该节点 X 轴倾斜角度。\n * @property skewX\n * @type {Number}\n * @example\n * node.skewX = 0;\n * cc.log(\"Node SkewX: \" + node.skewX);\n * @deprecated since v2.2.1\n */\n skewX: {\n get () {\n return this._skewX;\n },\n set (value) {\n _skewWarn(value, this);\n\n this._skewX = value;\n this.setLocalDirty(LocalDirtyFlag.SKEW);\n if (CC_JSB && CC_NATIVERENDERER) {\n this._proxy.updateSkew();\n }\n }\n },\n\n /**\n * !#en Skew y\n * !#zh 该节点 Y 轴倾斜角度。\n * @property skewY\n * @type {Number}\n * @example\n * node.skewY = 0;\n * cc.log(\"Node SkewY: \" + node.skewY);\n * @deprecated since v2.2.1\n */\n skewY: {\n get () {\n return this._skewY;\n },\n set (value) {\n _skewWarn(value, this);\n\n this._skewY = value;\n this.setLocalDirty(LocalDirtyFlag.SKEW);\n if (CC_JSB && CC_NATIVERENDERER) {\n this._proxy.updateSkew();\n }\n }\n },\n\n /**\n * !#en Opacity of node, default value is 255.\n * !#zh 节点透明度,默认值为 255。\n * @property opacity\n * @type {Number}\n * @example\n * node.opacity = 255;\n */\n opacity: {\n get () {\n return this._opacity;\n },\n set (value) {\n value = cc.misc.clampf(value, 0, 255);\n if (this._opacity !== value) {\n this._opacity = value;\n if (CC_JSB && CC_NATIVERENDERER) {\n this._proxy.updateOpacity();\n }\n this._renderFlag |= RenderFlow.FLAG_OPACITY_COLOR;\n }\n },\n range: [0, 255]\n },\n\n /**\n * !#en Color of node, default value is white: (255, 255, 255).\n * !#zh 节点颜色。默认为白色,数值为:(255,255,255)。\n * @property color\n * @type {Color}\n * @example\n * node.color = new cc.Color(255, 255, 255);\n */\n color: {\n get () {\n return this._color.clone()\n },\n set (value) {\n if (!this._color.equals(value)) {\n this._color.set(value);\n if (CC_DEV && value.a !== 255) {\n cc.warnID(1626);\n }\n\n this._renderFlag |= RenderFlow.FLAG_COLOR;\n\n if (this._eventMask & COLOR_ON) {\n this.emit(EventType.COLOR_CHANGED, value);\n }\n }\n },\n },\n\n /**\n * !#en Anchor point's position on x axis.\n * !#zh 节点 X 轴锚点位置。\n * @property anchorX\n * @type {Number}\n * @example\n * node.anchorX = 0;\n */\n anchorX: {\n get () {\n return this._anchorPoint.x;\n },\n set (value) {\n var anchorPoint = this._anchorPoint;\n if (anchorPoint.x !== value) {\n anchorPoint.x = value;\n if (this._eventMask & ANCHOR_ON) {\n this.emit(EventType.ANCHOR_CHANGED);\n }\n }\n },\n },\n\n /**\n * !#en Anchor point's position on y axis.\n * !#zh 节点 Y 轴锚点位置。\n * @property anchorY\n * @type {Number}\n * @example\n * node.anchorY = 0;\n */\n anchorY: {\n get () {\n return this._anchorPoint.y;\n },\n set (value) {\n var anchorPoint = this._anchorPoint;\n if (anchorPoint.y !== value) {\n anchorPoint.y = value;\n if (this._eventMask & ANCHOR_ON) {\n this.emit(EventType.ANCHOR_CHANGED);\n }\n }\n },\n },\n\n /**\n * !#en Width of node.\n * !#zh 节点宽度。\n * @property width\n * @type {Number}\n * @example\n * node.width = 100;\n */\n width: {\n get () {\n return this._contentSize.width;\n },\n set (value) {\n if (value !== this._contentSize.width) {\n if (CC_EDITOR) {\n var clone = cc.size(this._contentSize.width, this._contentSize.height);\n }\n this._contentSize.width = value;\n if (this._eventMask & SIZE_ON) {\n if (CC_EDITOR) {\n this.emit(EventType.SIZE_CHANGED, clone);\n }\n else {\n this.emit(EventType.SIZE_CHANGED);\n }\n }\n }\n },\n },\n\n /**\n * !#en Height of node.\n * !#zh 节点高度。\n * @property height\n * @type {Number}\n * @example\n * node.height = 100;\n */\n height: {\n get () {\n return this._contentSize.height;\n },\n set (value) {\n if (value !== this._contentSize.height) {\n if (CC_EDITOR) {\n var clone = cc.size(this._contentSize.width, this._contentSize.height);\n }\n this._contentSize.height = value;\n if (this._eventMask & SIZE_ON) {\n if (CC_EDITOR) {\n this.emit(EventType.SIZE_CHANGED, clone);\n }\n else {\n this.emit(EventType.SIZE_CHANGED);\n }\n }\n }\n },\n },\n\n /**\n * !#en zIndex is the 'key' used to sort the node relative to its siblings.
\n * The value of zIndex should be in the range between cc.macro.MIN_ZINDEX and cc.macro.MAX_ZINDEX.
\n * The Node's parent will sort all its children based on the zIndex value and the arrival order.
\n * Nodes with greater zIndex will be sorted after nodes with smaller zIndex.
\n * If two nodes have the same zIndex, then the node that was added first to the children's array will be in front of the other node in the array.
\n * Node's order in children list will affect its rendering order. Parent is always rendering before all children.\n * !#zh zIndex 是用来对节点进行排序的关键属性,它决定一个节点在兄弟节点之间的位置。
\n * zIndex 的取值应该介于 cc.macro.MIN_ZINDEX 和 cc.macro.MAX_ZINDEX 之间\n * 父节点主要根据节点的 zIndex 和添加次序来排序,拥有更高 zIndex 的节点将被排在后面,如果两个节点的 zIndex 一致,先添加的节点会稳定排在另一个节点之前。
\n * 节点在 children 中的顺序决定了其渲染顺序。父节点永远在所有子节点之前被渲染\n * @property zIndex\n * @type {Number}\n * @example\n * node.zIndex = 1;\n * cc.log(\"Node zIndex: \" + node.zIndex);\n */\n zIndex: {\n get () {\n return this._localZOrder >> 16;\n },\n set (value) {\n if (value > macro.MAX_ZINDEX) {\n cc.warnID(1636);\n value = macro.MAX_ZINDEX;\n }\n else if (value < macro.MIN_ZINDEX) {\n cc.warnID(1637);\n value = macro.MIN_ZINDEX;\n }\n\n if (this.zIndex !== value) {\n this._localZOrder = (this._localZOrder & 0x0000ffff) | (value << 16);\n this.emit(EventType.SIBLING_ORDER_CHANGED);\n\n this._onSiblingIndexChanged();\n }\n }\n },\n\n /**\n * !#en\n * Switch 2D/3D node. The 2D nodes will run faster.\n * !#zh\n * 切换 2D/3D 节点,2D 节点会有更高的运行效率\n * @property {Boolean} is3DNode\n * @default false\n */\n is3DNode: {\n get () {\n return this._is3DNode;\n }, set (v) {\n if (this._is3DNode === v) {\n return;\n }\n this._is3DNode = v;\n this._update3DFunction();\n }\n },\n\n /**\n * !#en Returns a normalized vector representing the up direction (Y axis) of the node in world space.\n * !#zh 获取节点正上方(y 轴)面对的方向,返回值为世界坐标系下的归一化向量\n *\n * @property up\n * @type {Vec3}\n */\n up: {\n get () {\n var _up = Vec3.transformQuat(_urfVec3, Vec3.UP, this.getWorldRotation(_urfQuat));\n return _up.clone();\n }\n },\n\n /**\n * !#en Returns a normalized vector representing the right direction (X axis) of the node in world space.\n * !#zh 获取节点正右方(x 轴)面对的方向,返回值为世界坐标系下的归一化向量\n *\n * @property right\n * @type {Vec3}\n */\n right: {\n get () {\n var _right = Vec3.transformQuat(_urfVec3, Vec3.RIGHT, this.getWorldRotation(_urfQuat));\n return _right.clone();\n }\n },\n\n /**\n * !#en Returns a normalized vector representing the forward direction (Z axis) of the node in world space.\n * !#zh 获取节点正前方(z 轴)面对的方向,返回值为世界坐标系下的归一化向量\n *\n * @property forward\n * @type {Vec3}\n */\n forward: {\n get () {\n var _forward = Vec3.transformQuat(_urfVec3, Vec3.FORWARD, this.getWorldRotation(_urfQuat));\n return _forward.clone();\n }\n },\n },\n\n /**\n * @method constructor\n * @param {String} [name]\n */\n ctor () {\n this._reorderChildDirty = false;\n\n // cache component\n this._widget = null;\n // fast render component access\n this._renderComponent = null;\n // Event listeners\n this._capturingListeners = null;\n this._bubblingListeners = null;\n // Touch event listener\n this._touchListener = null;\n // Mouse event listener\n this._mouseListener = null;\n\n this._initDataFromPool();\n\n this._eventMask = 0;\n this._cullingMask = 1;\n this._childArrivalOrder = 1;\n\n // Proxy\n if (CC_JSB && CC_NATIVERENDERER) {\n this._proxy = new renderer.NodeProxy(this._spaceInfo.unitID, this._spaceInfo.index, this._id, this._name);\n this._proxy.init(this);\n }\n // should reset _renderFlag for both web and native\n this._renderFlag = RenderFlow.FLAG_TRANSFORM | RenderFlow.FLAG_OPACITY_COLOR;\n },\n\n statics: {\n EventType,\n _LocalDirtyFlag: LocalDirtyFlag,\n // is node but not scene\n isNode (obj) {\n return obj instanceof Node && (obj.constructor === Node || !(obj instanceof cc.Scene));\n },\n BuiltinGroupIndex\n },\n\n // OVERRIDES\n\n _onSiblingIndexChanged () {\n // update rendering scene graph, sort them by arrivalOrder\n if (this._parent) {\n this._parent._delaySort();\n }\n },\n\n _onPreDestroy () {\n var destroyByParent = this._onPreDestroyBase();\n\n // Actions\n if (ActionManagerExist) {\n cc.director.getActionManager().removeAllActionsFromTarget(this);\n }\n\n // Remove Node.currentHovered\n if (_currentHovered === this) {\n _currentHovered = null;\n }\n\n this._bubblingListeners && this._bubblingListeners.clear();\n this._capturingListeners && this._capturingListeners.clear();\n\n // Remove all event listeners if necessary\n if (this._touchListener || this._mouseListener) {\n eventManager.removeListeners(this);\n if (this._touchListener) {\n this._touchListener.owner = null;\n this._touchListener.mask = null;\n this._touchListener = null;\n }\n if (this._mouseListener) {\n this._mouseListener.owner = null;\n this._mouseListener.mask = null;\n this._mouseListener = null;\n }\n }\n\n if (CC_JSB && CC_NATIVERENDERER) {\n this._proxy.destroy();\n this._proxy = null;\n }\n\n this._backDataIntoPool();\n\n if (this._reorderChildDirty) {\n cc.director.__fastOff(cc.Director.EVENT_AFTER_UPDATE, this.sortAllChildren, this);\n }\n\n if (!destroyByParent) {\n // simulate some destruct logic to make undo system work correctly\n if (CC_EDITOR) {\n // ensure this node can reattach to scene by undo system\n this._parent = null;\n }\n }\n },\n\n _onPostActivated (active) {\n var actionManager = ActionManagerExist ? cc.director.getActionManager() : null;\n if (active) {\n // Refresh transform\n this._renderFlag |= RenderFlow.FLAG_WORLD_TRANSFORM;\n // ActionManager & EventManager\n actionManager && actionManager.resumeTarget(this);\n eventManager.resumeTarget(this);\n // Search Mask in parent\n this._checkListenerMask();\n } else {\n // deactivate\n actionManager && actionManager.pauseTarget(this);\n eventManager.pauseTarget(this);\n }\n },\n\n _onHierarchyChanged (oldParent) {\n this._updateOrderOfArrival();\n // Fixed a bug where children and parent node groups were forced to synchronize, instead of only synchronizing `_cullingMask` value\n _updateCullingMask(this);\n if (this._parent) {\n this._parent._delaySort();\n }\n this._renderFlag |= RenderFlow.FLAG_WORLD_TRANSFORM | RenderFlow.FLAG_OPACITY_COLOR;\n this._onHierarchyChangedBase(oldParent);\n if (cc._widgetManager) {\n cc._widgetManager._nodesOrderDirty = true;\n }\n\n if (oldParent && this._activeInHierarchy) {\n //TODO: It may be necessary to update the listener mask of all child nodes.\n this._checkListenerMask();\n }\n\n // Node proxy\n if (CC_JSB && CC_NATIVERENDERER) {\n this._proxy.updateParent();\n }\n },\n\n // INTERNAL\n\n _update3DFunction () {\n if (this._is3DNode) {\n this._updateLocalMatrix = updateLocalMatrix3D;\n this._calculWorldMatrix = calculWorldMatrix3D;\n this._mulMat = mulMat3D;\n }\n else {\n this._updateLocalMatrix = updateLocalMatrix2D;\n this._calculWorldMatrix = calculWorldMatrix2D;\n this._mulMat = mulMat2D;\n }\n if (this._renderComponent && this._renderComponent._on3DNodeChanged) {\n this._renderComponent._on3DNodeChanged();\n }\n this._renderFlag |= RenderFlow.FLAG_TRANSFORM;\n this._localMatDirty = LocalDirtyFlag.ALL;\n\n if (CC_JSB && CC_NATIVERENDERER) {\n this._proxy.update3DNode();\n }\n },\n\n _initDataFromPool () {\n if (!this._spaceInfo) {\n if (CC_EDITOR || CC_TEST) {\n this._spaceInfo = {\n trs: new Float64Array(10),\n localMat: new Float64Array(16),\n worldMat: new Float64Array(16),\n };\n } else {\n this._spaceInfo = nodeMemPool.pop();\n }\n }\n\n let spaceInfo = this._spaceInfo;\n this._matrix = cc.mat4(spaceInfo.localMat);\n Mat4.identity(this._matrix);\n this._worldMatrix = cc.mat4(spaceInfo.worldMat);\n Mat4.identity(this._worldMatrix);\n this._localMatDirty = LocalDirtyFlag.ALL;\n this._worldMatDirty = true;\n\n let trs = this._trs = spaceInfo.trs;\n trs[0] = 0; // position.x\n trs[1] = 0; // position.y\n trs[2] = 0; // position.z\n trs[3] = 0; // rotation.x\n trs[4] = 0; // rotation.y\n trs[5] = 0; // rotation.z\n trs[6] = 1; // rotation.w\n trs[7] = 1; // scale.x\n trs[8] = 1; // scale.y\n trs[9] = 1; // scale.z\n },\n\n _backDataIntoPool () {\n if (!(CC_EDITOR || CC_TEST)) {\n // push back to pool\n nodeMemPool.push(this._spaceInfo);\n this._matrix = null;\n this._worldMatrix = null;\n this._trs = null;\n this._spaceInfo = null;\n }\n },\n\n _toEuler () {\n if (this.is3DNode) {\n Trs.toEuler(this._eulerAngles, this._trs);\n }\n else {\n let z = Math.asin(this._trs[5]) / ONE_DEGREE * 2;\n Vec3.set(this._eulerAngles, 0, 0, z);\n }\n },\n\n _fromEuler () {\n if (this.is3DNode) {\n Trs.fromEuler(this._trs, this._eulerAngles);\n }\n else {\n Trs.fromAngleZ(this._trs, this._eulerAngles.z);\n }\n },\n\n _initProperties () {\n if (this._is3DNode) {\n this._update3DFunction();\n }\n\n let trs = this._trs;\n if (trs) {\n let desTrs = trs;\n trs = this._trs = this._spaceInfo.trs;\n // just adapt to old trs\n if (desTrs.length === 11) {\n trs.set(desTrs.subarray(1));\n } else {\n trs.set(desTrs);\n }\n } else {\n trs = this._trs = this._spaceInfo.trs;\n }\n\n if (CC_EDITOR) {\n if (this._skewX !== 0 || this._skewY !== 0) {\n var NodeUtils = Editor.require('scene://utils/node');\n cc.warn(\"`cc.Node.skewX/Y` is deprecated since v2.2.1, please use 3D node instead.\", `Node: ${NodeUtils.getNodePath(this)}.`);\n }\n }\n\n this._fromEuler();\n\n if (CC_JSB && CC_NATIVERENDERER) {\n this._renderFlag |= RenderFlow.FLAG_TRANSFORM | RenderFlow.FLAG_OPACITY_COLOR;\n }\n },\n\n /*\n * The initializer for Node which will be called before all components onLoad\n */\n _onBatchCreated (dontSyncChildPrefab) {\n this._initProperties();\n\n // Fixed a bug where children and parent node groups were forced to synchronize, instead of only synchronizing `_cullingMask` value\n this._cullingMask = 1 << _getActualGroupIndex(this);\n if (CC_JSB && CC_NATIVERENDERER) {\n this._proxy && this._proxy.updateCullingMask();\n }\n\n if (!this._activeInHierarchy) {\n if (CC_EDITOR ? cc.director.getActionManager() : ActionManagerExist) {\n // deactivate ActionManager and EventManager by default\n cc.director.getActionManager().pauseTarget(this);\n }\n eventManager.pauseTarget(this);\n }\n\n let children = this._children;\n for (let i = 0, len = children.length; i < len; i++) {\n let child = children[i];\n if (!dontSyncChildPrefab) {\n // sync child prefab\n let prefabInfo = child._prefab;\n if (prefabInfo && prefabInfo.sync && prefabInfo.root === child) {\n PrefabHelper.syncWithPrefab(child);\n }\n child._updateOrderOfArrival();\n }\n child._onBatchCreated(dontSyncChildPrefab);\n }\n\n if (children.length > 0) {\n this._renderFlag |= RenderFlow.FLAG_CHILDREN;\n }\n\n if (CC_JSB && CC_NATIVERENDERER) {\n this._proxy.initNative();\n }\n },\n\n // EVENT TARGET\n _checkListenerMask () {\n // Because Mask may be nested, need to find all the Mask components in the parent node.\n // The click area must satisfy all Masks to trigger the click.\n if (this._touchListener) {\n var mask = this._touchListener.mask = _searchComponentsInParent(this, cc.Mask);\n if (this._mouseListener) {\n this._mouseListener.mask = mask;\n }\n } else if (this._mouseListener) {\n this._mouseListener.mask = _searchComponentsInParent(this, cc.Mask);\n }\n },\n\n _checknSetupSysEvent (type) {\n let newAdded = false;\n let forDispatch = false;\n if (_touchEvents.indexOf(type) !== -1) {\n if (!this._touchListener) {\n this._touchListener = cc.EventListener.create({\n event: cc.EventListener.TOUCH_ONE_BY_ONE,\n swallowTouches: true,\n owner: this,\n mask: _searchComponentsInParent(this, cc.Mask),\n onTouchBegan: _touchStartHandler,\n onTouchMoved: _touchMoveHandler,\n onTouchEnded: _touchEndHandler,\n onTouchCancelled: _touchCancelHandler\n });\n eventManager.addListener(this._touchListener, this);\n newAdded = true;\n }\n forDispatch = true;\n }\n else if (_mouseEvents.indexOf(type) !== -1) {\n if (!this._mouseListener) {\n this._mouseListener = cc.EventListener.create({\n event: cc.EventListener.MOUSE,\n _previousIn: false,\n owner: this,\n mask: _searchComponentsInParent(this, cc.Mask),\n onMouseDown: _mouseDownHandler,\n onMouseMove: _mouseMoveHandler,\n onMouseUp: _mouseUpHandler,\n onMouseScroll: _mouseWheelHandler,\n });\n eventManager.addListener(this._mouseListener, this);\n newAdded = true;\n }\n forDispatch = true;\n }\n if (newAdded && !this._activeInHierarchy) {\n cc.director.getScheduler().schedule(function () {\n if (!this._activeInHierarchy) {\n eventManager.pauseTarget(this);\n }\n }, this, 0, 0, 0, false);\n }\n return forDispatch;\n },\n\n /**\n * !#en\n * Register a callback of a specific event type on Node.
\n * Use this method to register touch or mouse event permit propagation based on scene graph,
\n * These kinds of event are triggered with dispatchEvent, the dispatch process has three steps:
\n * 1. Capturing phase: dispatch in capture targets (`_getCapturingTargets`), e.g. parents in node tree, from root to the real target
\n * 2. At target phase: dispatch to the listeners of the real target
\n * 3. Bubbling phase: dispatch in bubble targets (`_getBubblingTargets`), e.g. parents in node tree, from the real target to root
\n * In any moment of the dispatching process, it can be stopped via `event.stopPropagation()` or `event.stopPropagationImmidiate()`.
\n * It's the recommended way to register touch/mouse event for Node,
\n * please do not use cc.eventManager directly for Node.
\n * You can also register custom event and use `emit` to trigger custom event on Node.
\n * For such events, there won't be capturing and bubbling phase, your event will be dispatched directly to its listeners registered on the same node.
\n * You can also pass event callback parameters with `emit` by passing parameters after `type`.\n * !#zh\n * 在节点上注册指定类型的回调函数,也可以设置 target 用于绑定响应函数的 this 对象。
\n * 鼠标或触摸事件会被系统调用 dispatchEvent 方法触发,触发的过程包含三个阶段:
\n * 1. 捕获阶段:派发事件给捕获目标(通过 `_getCapturingTargets` 获取),比如,节点树中注册了捕获阶段的父节点,从根节点开始派发直到目标节点。
\n * 2. 目标阶段:派发给目标节点的监听器。
\n * 3. 冒泡阶段:派发事件给冒泡目标(通过 `_getBubblingTargets` 获取),比如,节点树中注册了冒泡阶段的父节点,从目标节点开始派发直到根节点。
\n * 同时您可以将事件派发到父节点或者通过调用 stopPropagation 拦截它。
\n * 推荐使用这种方式来监听节点上的触摸或鼠标事件,请不要在节点上直接使用 cc.eventManager。
\n * 你也可以注册自定义事件到节点上,并通过 emit 方法触发此类事件,对于这类事件,不会发生捕获冒泡阶段,只会直接派发给注册在该节点上的监听器
\n * 你可以通过在 emit 方法调用时在 type 之后传递额外的参数作为事件回调的参数列表\n * @method on\n * @param {String|Node.EventType} type - A string representing the event type to listen for.
See {{#crossLink \"Node/EventTyupe/POSITION_CHANGED\"}}Node Events{{/crossLink}} for all builtin events.\n * @param {Function} callback - The callback that will be invoked when the event is dispatched. The callback is ignored if it is a duplicate (the callbacks are unique).\n * @param {Event|any} [callback.event] event or first argument when emit\n * @param {any} [callback.arg2] arg2\n * @param {any} [callback.arg3] arg3\n * @param {any} [callback.arg4] arg4\n * @param {any} [callback.arg5] arg5\n * @param {Object} [target] - The target (this object) to invoke the callback, can be null\n * @param {Boolean} [useCapture=false] - When set to true, the listener will be triggered at capturing phase which is ahead of the final target emit, otherwise it will be triggered during bubbling phase.\n * @return {Function} - Just returns the incoming callback so you can save the anonymous function easier.\n * @typescript\n * on
\n * The node becomes the action's target. Refer to cc.Action's getTarget()
\n * Calling runAction while the node is not active won't have any effect.
\n * Note:You shouldn't modify the action after runAction, that won't take any effect.
\n * if you want to modify, when you define action plus.\n * !#zh\n * 执行并返回该执行的动作。该节点将会变成动作的目标。
\n * 调用 runAction 时,节点自身处于不激活状态将不会有任何效果。
\n * 注意:你不应该修改 runAction 后的动作,将无法发挥作用,如果想进行修改,请在定义 action 时加入。\n * @method runAction\n * @param {Action} action\n * @return {Action} An Action pointer\n * @example\n * var action = cc.scaleTo(0.2, 1, 0.6);\n * node.runAction(action);\n * node.runAction(action).repeatForever(); // fail\n * node.runAction(action.repeatForever()); // right\n */\n runAction: ActionManagerExist ? function (action) {\n if (!this.active)\n return;\n cc.assertID(action, 1618);\n let am = cc.director.getActionManager();\n if (!am._suppressDeprecation) {\n am._suppressDeprecation = true;\n cc.warnID(1639);\n }\n am.addAction(action, this, false);\n return action;\n } : emptyFunc,\n\n /**\n * !#en Pause all actions running on the current node. Equals to `cc.director.getActionManager().pauseTarget(node)`.\n * !#zh 暂停本节点上所有正在运行的动作。和 `cc.director.getActionManager().pauseTarget(node);` 等价。\n * @method pauseAllActions\n * @example\n * node.pauseAllActions();\n */\n pauseAllActions: ActionManagerExist ? function () {\n cc.director.getActionManager().pauseTarget(this);\n } : emptyFunc,\n\n /**\n * !#en Resume all paused actions on the current node. Equals to `cc.director.getActionManager().resumeTarget(node)`.\n * !#zh 恢复运行本节点上所有暂停的动作。和 `cc.director.getActionManager().resumeTarget(node);` 等价。\n * @method resumeAllActions\n * @example\n * node.resumeAllActions();\n */\n resumeAllActions: ActionManagerExist ? function () {\n cc.director.getActionManager().resumeTarget(this);\n } : emptyFunc,\n\n /**\n * !#en Stops and removes all actions from the running action list .\n * !#zh 停止并且移除所有正在运行的动作列表。\n * @method stopAllActions\n * @example\n * node.stopAllActions();\n */\n stopAllActions: ActionManagerExist ? function () {\n cc.director.getActionManager().removeAllActionsFromTarget(this);\n } : emptyFunc,\n\n /**\n * !#en Stops and removes an action from the running action list.\n * !#zh 停止并移除指定的动作。\n * @method stopAction\n * @param {Action} action An action object to be removed.\n * @example\n * var action = cc.scaleTo(0.2, 1, 0.6);\n * node.stopAction(action);\n */\n stopAction: ActionManagerExist ? function (action) {\n cc.director.getActionManager().removeAction(action);\n } : emptyFunc,\n\n /**\n * !#en Removes an action from the running action list by its tag.\n * !#zh 停止并且移除指定标签的动作。\n * @method stopActionByTag\n * @param {Number} tag A tag that indicates the action to be removed.\n * @example\n * node.stopActionByTag(1);\n */\n stopActionByTag: ActionManagerExist ? function (tag) {\n if (tag === cc.Action.TAG_INVALID) {\n cc.logID(1612);\n return;\n }\n cc.director.getActionManager().removeActionByTag(tag, this);\n } : emptyFunc,\n\n /**\n * !#en Returns an action from the running action list by its tag.\n * !#zh 通过标签获取指定动作。\n * @method getActionByTag\n * @see cc.Action#getTag and cc.Action#setTag\n * @param {Number} tag\n * @return {Action} The action object with the given tag.\n * @example\n * var action = node.getActionByTag(1);\n */\n getActionByTag: ActionManagerExist ? function (tag) {\n if (tag === cc.Action.TAG_INVALID) {\n cc.logID(1613);\n return null;\n }\n return cc.director.getActionManager().getActionByTag(tag, this);\n } : function () {\n return null;\n },\n\n /**\n * !#en\n * Returns the numbers of actions that are running plus the ones that are schedule to run (actions in actionsToAdd and actions arrays).
\n * Composable actions are counted as 1 action. Example:
\n * If you are running 1 Sequence of 7 actions, it will return 1.
\n * If you are running 7 Sequences of 2 actions, it will return 7.